home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 365.8 KB | 11,152 lines | [DIFf/DIFf] |
- dCompatibility classes
- rControl classes
- fCArrowPopupPane.p
- x78533107,312329531
- a{****************************************************************************}
- c1,10
- a{****************************************************************************}
- c12,20
- a kPaneSize = 20; { height and width of pane }
- c19,19
- c23,25
- a{****************************************************************************}
- c27,32
- a{****************************************************************************}
- c34,43
- a{****************************************************************************}
- c45,47
- a{****************************************************************************}
- c49,56
- a{****************************************************************************}
- c58,60
- a{****************************************************************************}
- c62,71
- a{****************************************************************************}
- c73,75
- a{****************************************************************************}
- c77,86
- a{****************************************************************************}
- c88,91
- a{****************************************************************************}
- c93,102
- e
- fCButton.p
- x464440633,285932625
- a{****************************************************************************}
- c1,17
- a{****************************************************************************}
- c19,27
- a kFlashDelay = 8; { number of ticks to hilte button }
- a kDefaultBtnRounding = 16; { rounding diameter for default button border }
- c27,27
- c31,32
- a{*** C O N S T R U C T I O N M E T H O D S ***}
- c30,30
- a{****************************************************************************}
- c36,38
- a{****************************************************************************}
- c34,34
- aPROCEDURE CButton.IButton (CNTLid: Integer; { CNTL resource ID }
- a anEnclosure: CView; { Enclosing view }
- a aSupervisor: CBureaucrat); { Boss in chain of command }
- c44,78
- a { Set up Frame coordinates }
- c80,80
- a { Determine visible portion }
- c82,83
- a { This is a subview of enclosure }
- a itsEnclosure.AddSubview(self);
- c86,97
- a{****************************************************************************}
- c99,102
- a{****************************************************************************}
- c104,128
- a{****************************************************************************}
- c130,130
- a{****************************************************************************}
- c132,137
- a{*** C L I C K H A N D L I N G M E T H O D S ***}
- c125,125
- c125,125
- a{****************************************************************************}
- c142,145
- a{****************************************************************************}
- c128,128
- aPROCEDURE CButton.DoGoodClick (whichPart: Integer); { Will always be inButton }
- c133,133
- a { Issue the appropriate command }
- c151,155
- a{****************************************************************************}
- c157,160
- a{****************************************************************************}
- aPROCEDURE CButton.SetClickCmd (aClickCmd: Longint); { Specified command number }
- c137,137
- c149,149
- a { Set instance variable }
- c166,168
- a{****************************************************************************}
- c170,173
- a{****************************************************************************}
- c175,179
- a{****************************************************************************}
- c181,184
- a{****************************************************************************}
- c155,155
- c187,208
- a{****************************************************************************}
- c210,213
- a{****************************************************************************}
- c186,186
- c216,225
- a DoGoodClick(kControlButtonPart);
- c205,207
- c230,230
- e
- fCCheckBox.p
- x241947381,498931489
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,25
- a{**************************************************}
- c27,30
- a{**************************************************}
- c32,39
- a{**************************************************}
- c41,44
- a{**************************************************}
- c46,55
- a{**************************************************}
- c57,63
- a{**************************************************}
- c65,70
- a SetValue(1 - GetControlValue(macControl));
- c65,65
- c73,77
- a{**************************************************}
- c79,82
- a{**************************************************}
- c76,76
- c85,86
- a IsChecked := GetControlValue(macControl) = BUTTON_ON;
- c88,90
- e
- fCIconPane.p
- x96552240,343629127
- a{****************************************************************************}
- c1,10
- a{****************************************************************************}
- c12,17
- a Icons, TCL_Controls;
- c16,16
- c20,33
- a{$IFC MAC68K}
- c34,35
- a{$ELSEC}
- aBEGIN
- a tcl_PlotCIconHandle := PlotCIconHandle(theRect, align, transform, theCIcon);
- aEND;
- a{$ENDC}
- c36,37
- a{****************************************************************************}
- c39,44
- a{****************************************************************************}
- c46,59
- a{****************************************************************************}
- c61,63
- a{****************************************************************************}
- c65,80
- a{****************************************************************************}
- c82,84
- a{****************************************************************************}
- c80,80
- c87,91
- a { If color is desired and Color QD is available, then look for }
- a { a matching 'cicn' resource. }
- c86,86
- c95,104
- a { set up the bitmap }
- a { point to the mask bits }
- c107,110
- a { TCL 1.1.2 DLP 12/10/91: check for Icon Utilities trap }
- c104,104
- c113,115
- a{****************************************************************************}
- c117,122
- a{****************************************************************************}
- c124,140
- a transform := $4000; { draw selected }
- c142,145
- a transform := 0; { draw normal }
- c147,148
- a IF gSystem.hasColorQD THEN { Preserve foreground and background }
- c139,139
- c151,153
- a ForeColor(blackColor); { Set default colors for CopyBits }
- c155,173
- a { dim the icon by dividing all RGB values by 2 }
- c175,185
- a { restore the original color table, free the copy }
- c170,170
- c188,188
- a DisposeCTable(ctab);
- c190,201
- a CopyBits(cMaskBitMap, qd.thePort^.portBits, theBounds, theBounds, copyMode, NIL);
- a CopyBits(theImage, qd.thePort^.portBits, theBounds, theBounds, srcXor, NIL);
- c204,206
- a IF gSystem.hasColorQD THEN { restore the colors }
- c196,196
- c209,213
- a{****************************************************************************}
- c215,217
- a{****************************************************************************}
- c219,223
- a{****************************************************************************}
- c225,227
- a{****************************************************************************}
- c229,233
- a{****************************************************************************}
- c235,237
- a{****************************************************************************}
- c239,243
- a{****************************************************************************}
- c245,248
- a{****************************************************************************}
- c250,259
- a{****************************************************************************}
- c261,263
- a{****************************************************************************}
- c265,293
- a{****************************************************************************}
- c295,297
- a{****************************************************************************}
- c299,302
- a DisposeCIcon(cicnH);
- c304,309
- e
- fCPopupMenu.p
- x254628646,261239551
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,18
- a TCL_Controls, Fonts;
- c17,17
- c21,22
- a{****************************************************************************}
- c24,31
- a{****************************************************************************}
- c33,43
- a {)
- c45,46
- a{ }
- c48,49
- a IF (menu = NIL) THEN { no it hasn't }
- c51,51
- a { add the menu, but don't install into the menu list }
- c53,54
- a { NOTE: we never call DisposeMenu( macMenu) because the Bartender }
- a { has a copy of it AND because there is no way to tell if this }
- a { menu handle is shared with other objects. We could allocate a }
- a { private copy, but then the menu would be hidden from the Bartender }
- c49,49
- c60,61
- a { it better have been found now }
- c63,71
- a{****************************************************************************}
- c73,76
- a{****************************************************************************}
- c65,65
- c79,80
- a { Never dim menu items }
- c82,83
- a { When autoSelect is TRUE, menu items are automatically checked }
- a { when selected and selections are remembered. If it is FALSE, then }
- a { menu items should be checked via the UpdateMenus mechanism }
- c71,71
- c88,93
- a{****************************************************************************}
- c95,97
- a{****************************************************************************}
- c99,100
- a AppendResMenu(macMenu, aResType);
- c83,83
- c92,93
- a{****************************************************************************}
- c106,110
- a{****************************************************************************}
- c112,113
- a VAR macEvent: EventRecord;
- c115,128
- a UpperString(buf, FALSE);
- c130,145
- a{****************************************************************************}
- c147,149
- a{****************************************************************************}
- c151,155
- a{****************************************************************************}
- c157,159
- a{****************************************************************************}
- c161,165
- a{****************************************************************************}
- c167,169
- a{****************************************************************************}
- c171,175
- a{****************************************************************************}
- c177,179
- a{****************************************************************************}
- c181,186
- a{****************************************************************************}
- c188,194
- a{****************************************************************************}
- c196,212
- a {)
- c214,218
- a{ }
- c186,186
- c205,205
- c222,229
- a{****************************************************************************}
- c231,235
- a{****************************************************************************}
- c237,243
- a itemCount := CountMItems(macMenu);
- c244,245
- a GetMenuItemText(macMenu, i, itemString);
- c247,254
- a{****************************************************************************}
- c256,258
- a{****************************************************************************}
- c260,267
- a{****************************************************************************}
- c269,276
- a{****************************************************************************}
- c278,288
- a { The caller can specify the initially selected item by passing }
- a { in its command number. If none is specified, then one is }
- a { calculated. If autoSelection is on, then the first selected item }
- a { is used, otherwise the last item chosen is used. Finally, if all }
- a { else fails, the first menu item is used. }
- c254,254
- c295,312
- a { insert into menu list }
- c314,318
- a { remove from menu list }
- c320,321
- a mID := HiWord(menuResult); { could be submenu }
- c323,324
- a { FindCmdNumber will return a positive integer if }
- a { there is a command for this item or a negative number }
- a { if the menu was registered but the item has no command. }
- a { If the menu was not registered it will return cmdNull. }
- c286,286
- c295,295
- c331,332
- a { notify dependents and supervisor of the new selection }
- c334,338
- a { return the last resulting command }
- c340,343
- a{****************************************************************************}
- c345,348
- a{****************************************************************************}
- c350,373
- a{****************************************************************************}
- c375,377
- a{****************************************************************************}
- c379,382
- a GetMenuItemText(macMenu, item, itemStr);
- c342,343
- a{****************************************************************************}
- c387,389
- a{****************************************************************************}
- c391,401
- a{****************************************************************************}
- c403,405
- a{****************************************************************************}
- c407,411
- a{****************************************************************************}
- c413,415
- a{****************************************************************************}
- c417,423
- a { make sure that item does not have hierarchical menu, }
- a { otherwise clearing item mark would lose the submenu }
- c426,427
- a IF fCheckIt THEN
- c429,436
- e
- fCPopupPane.p
- x69439093,106703325
- a{****************************************************************************}
- c1,13
- a{****************************************************************************}
- c15,24
- a{****************************************************************************}
- c26,29
- a{****************************************************************************}
- c31,42
- a{****************************************************************************}
- c44,46
- a{****************************************************************************}
- c48,58
- a{****************************************************************************}
- c60,63
- a{****************************************************************************}
- c65,71
- a itsMenu.IPopupMenu(menuID, self, fAutoSelect, fMultiSelect);
- c73,74
- a{****************************************************************************}
- c76,78
- a{****************************************************************************}
- c80,84
- a{****************************************************************************}
- c86,89
- a{****************************************************************************}
- c91,96
- a{****************************************************************************}
- c98,102
- a{****************************************************************************}
- c104,115
- a{****************************************************************************}
- c117,120
- a{****************************************************************************}
- c122,129
- a{****************************************************************************}
- c131,135
- a{****************************************************************************}
- c137,141
- a{****************************************************************************}
- c143,147
- a{****************************************************************************}
- c149,150
- a { null method }
- c140,141
- a{****************************************************************************}
- c155,159
- a{****************************************************************************}
- c161,171
- a{****************************************************************************}
- c173,177
- a{****************************************************************************}
- c179,181
- a IF NOT IsActive THEN { TCL 1.1.2 DLP 12/16/91 }
- c183,183
- a PenPat(qd.gray);
- c185,190
- a{****************************************************************************}
- c192,194
- a{****************************************************************************}
- c196,201
- a{****************************************************************************}
- c203,206
- a{****************************************************************************}
- c180,180
- c209,214
- a{****************************************************************************}
- c216,218
- a{****************************************************************************}
- c190,190
- c221,227
- e
- fCRadioControl.p
- x194209077,102370577
- a{****************************************************************************}
- c1,13
- a{****************************************************************************}
- c15,24
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c24,24
- a{****************************************************************************}
- c28,30
- a{****************************************************************************}
- c32,38
- a{****************************************************************************}
- c40,42
- a{****************************************************************************}
- c44,52
- a{****************************************************************************}
- c54,58
- a{****************************************************************************}
- aPROCEDURE CRadioControl.DoGoodClick (whichPart: Integer); { Will always be inButton }
- c61,70
- e
- fCRadioGroupPane.p
- x136533251,203658229
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,26
- a{****************************************************************************}
- c28,30
- a{****************************************************************************}
- c32,45
- a{****************************************************************************}
- c47,49
- a{****************************************************************************}
- c51,58
- a{****************************************************************************}
- c60,66
- a{****************************************************************************}
- c68,84
- a{****************************************************************************}
- c86,88
- a{****************************************************************************}
- c82,82
- c91,107
- a Assert(member(radio, CRadioControl));
- c109,114
- a{****************************************************************************}
- c116,118
- a{****************************************************************************}
- c112,112
- c121,130
- e
- fCStdPopupPane.p
- x203373363,471006488
- a{****************************************************************************}
- c1,10
- a{****************************************************************************}
- c12,22
- a Script, Fonts
- a{$IFC POWERPC}
- a , MixedMode
- c171,171
- a ;
- c24,27
- a kArrowWidth = 16; { width needed for popup arrow}
- a kArrowRightInset = 3; { inset of arrow with right edge of border}
- a kTitleGap = 6; { gap between end of title and popup box }
- a kStdPopupHeight = 21; { standard height for popup}
- a kCheckGap = 14; { Pixels between left edge of menu }
- a { and left edge of text}
- a kBorderWidth = 2; { width of border, 1 pixel frame + i pixel shadow}
- c26,26
- a kMinTicks = 8; { number of ticks to flash title for feedback for keyboard shortcut }
- c27,27
- c35,35
- a{ if INSTALL_MENU_HOOK is true the menu defproc will be patched}
- a{ to provide the standard popup menu width}
- c35,35
- c35,35
- c43,44
- a{$IFC POWERPC}
- aPROCEDURE BuildRoutineDescriptor(
- a VAR aDescriptor : RoutineDescriptor;
- a procInfo : ProcInfoType;
- a theProc : ProcPtr); C; EXTERNAL;
- c35,35
- c171,172
- c45,46
- a{$IFC MAC68K}
- c47,51
- a{$ELSEC}
- c47,47
- a addr: RoutineDescriptor;
- c50,51
- c171,171
- c52,60
- a{$IFC MAC68K}
- c61,62
- a{$ELSEC}
- aBEGIN
- a CallMenuDefProc(message, menu, menuRect, hitPt, whichItem, MenuDefUPP(defproc^));
- aEND;
- c171,172
- c64,70
- a{****************************************************************************}
- c72,76
- a{****************************************************************************}
- c78,84
- a { We need to know if this is the first time we're installing}
- a { this menu so we install the menu hook only once.}
- c87,93
- a{****************************************************************************}
- c95,97
- a{****************************************************************************}
- c99,116
- a{****************************************************************************}
- c118,122
- a{****************************************************************************}
- c116,116
- c125,139
- a{$IFC INSTALL_MENU_HOOK & POWERPC}
- aVAR
- a routine: tMenuHook;
- c171,172
- a{****************************************************************************}
- c141,149
- a{****************************************************************************}
- c151,152
- a theHook: tMenuHookHndl;
- a menu: MenuHandle;
- a{$IFC POWERPC}
- a err: OSErr;
- c171,171
- c155,158
- c160,161
- a{$IFC MAC68K}
- c159,159
- c163,163
- a theHook^^.jmp := $4EF9; { JMP instruction }
- c165,166
- a{$ELSEC}
- a BuildRoutineDescriptor(routine.addr, uppMenuDefProcInfo, @MenuProc);
- a routine.realMenuProc := menu^^.menuProc;
- a err := PtrToHand(@routine, Handle(theHook), sizeof(tMenuHook));
- c171,171
- c167,168
- a{$IFC MAC68K}
- c169,169
- c171,171
- c171,174
- a{****************************************************************************}
- c176,179
- a{****************************************************************************}
- c181,192
- a { fontAscent is used when drawing the popup title and selected item }
- c194,196
- a { calculte width such that title, the longest menu item, and }
- a { the down arrow all fit correctly }
- c199,207
- a { calculate the height given the chosen font, but make sure }
- a { the height is at least an appropriate minimum size }
- c210,218
- a { calculate the rect to hilite when the menu pops up, as per HIG }
- c220,221
- a { calculate the position to draw the down arrow SICN }
- c200,200
- c224,227
- a{****************************************************************************}
- c229,231
- a{****************************************************************************}
- c233,244
- a itsPopupBox.IPane(self, self, bWidth, height - kBorderWidth - 1, popupPt.h, 1, sizFIXEDSTICKY, sizFIXEDSTICKY);
- c221,221
- c247,252
- a{****************************************************************************}
- c254,258
- a{****************************************************************************}
- c260,266
- a { is the click in the popup box? }
- c268,273
- a { pass the popupPt as the hitPt }
- c246,246
- c276,280
- a{****************************************************************************}
- c282,285
- a{****************************************************************************}
- c287,290
- a { the text is inside the popup box, so invalidate the interior }
- a { minus the portion used for the down arrow icon }
- c275,275
- c294,298
- a{ number of ticks to flash title for feedback }
- a{****************************************************************************}
- c301,305
- a{****************************************************************************}
- c275,275
- c308,309
- a VAR macEvent: EventRecord);
- c288,288
- c312,326
- a{****************************************************************************}
- c328,330
- a{****************************************************************************}
- c332,339
- a{****************************************************************************}
- c341,343
- a{****************************************************************************}
- c345,353
- a{****************************************************************************}
- c355,358
- a{****************************************************************************}
- c360,373
- a{****************************************************************************}
- c375,378
- a{****************************************************************************}
- c380,382
- a itsPopupBox.GetBorder.SetPattern(qd.black);
- c338,339
- a{****************************************************************************}
- c387,390
- a{****************************************************************************}
- c392,394
- a itsPopupBox.GetBorder.SetPattern(qd.gray);
- c352,353
- c353,353
- a{ This is the custom menu defproc that is called by the Menu Manager }
- a{ All it does is call the original defproc and then check if the }
- a{ message was mSizeMsg. If it was, it patches the menuWidth to allow }
- a{ room for the down arrow }
- c353,353
- c404,415
- a { get handle to the real menu proc }
- c373,373
- c418,430
- e
- fTCL_Controls.p
- x443301951,329412429
- a{****************************************************************************}
- c1,6
- a{****************************************************************************}
- c8,13
- a Icons, TCL;
- c12,12
- c15,16
- a{****************************************************************************}
- c19,29
- a{****************************************************************************}
- c31,59
- a BUTTON_OFF = 0; { Off setting }
- a BUTTON_ON = 1; { On setting }
- c57,57
- c57,57
- a{**************************************************}
- c65,68
- a{**************************************************}
- c62,62
- c71,74
- a { Instance Methods }
- c70,70
- c77,91
- a{****************************************************************************}
- c93,93
- a{****************************************************************************}
- c95,111
- a{****************************************************************************}
- c113,113
- a{****************************************************************************}
- c111,111
- c116,142
- a{****************************************************************************}
- c144,145
- a{****************************************************************************}
- c134,134
- c148,149
- a kIconPixels = 32; { ICON is 32 pixels square }
- a kIconBytes = 128; { ICON is 128 bytes of data }
- a kIconRowBytes = 4; { 32 b&w pixels is 4 bytes }
- c134,134
- c154,196
- a { Class Variables }
- c186,186
- a { This bit map and buffer are used for drawing the icon in }
- a { either normal or hilite mode }
- c186,186
- c202,205
- a{****************************************************************************}
- c207,208
- a{****************************************************************************}
- c186,187
- c195,195
- a { modifier passed to SelectItem & SelectItemName }
- c195,195
- c215,218
- a tPMSelectAction = (pmForceOn, { check item - only allowed option for single selection menus }
- a pmToggle, { toggle the item (multiSelect only) }
- a pmForceOff { uncheck item (multiSelect only }
- c222,225
- a macMenu: MenuHandle; { handle to menu }
- a menuID: Integer; { ID of the menu }
- a lastCmd: Longint; { last command issued }
- a autoSelect: Boolean; { automatically checks items if TRUE }
- a multiSelect: Boolean; { allow multiple checked items if TRUE }
- a firstSelection: Integer; { first selected menu item number }
- c198,198
- c233,238
- a VAR macEvent: EventRecord;
- c240,264
- a { Change protocol for CPopupMenu }
- c232,232
- a { a new item was selected. Info parameter is }
- a { a pointer (IntegerPtr) to the new item number}
- c232,232
- c270,272
- a{****************************************************************************}
- c274,275
- a{****************************************************************************}
- c262,262
- c278,323
- a { CPopupPane template }
- c323,323
- c326,334
- a{****************************************************************************}
- c336,337
- a {****************************************************************************}
- c323,323
- c340,368
- a VAR macEvent: EventRecord);
- c360,360
- c371,385
- a{ CStdPopupPane template }
- c342,342
- c388,390
- a hAutosizing: Integer; { auto-size horizontally?}
- a vAutosizing: Integer; { auto-size vertically?}
- c384,384
- c394,397
- a { Use for width or height parameters of IStdPopupPane }
- a { for automatic sizing of popup }
- c352,352
- c401,402
- a{****************************************************************************}
- c404,405
- a{****************************************************************************}
- c388,388
- c408,430
- e
- o
- rCore classes
- fCAbstractText.p
- x113167812,91801788
- a{****************************************************************************}
- c1,35
- a{****************************************************************************}
- c37,47
- a Script, Fonts;
- c46,46
- c49,49
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c49,49
- a{****************************************************************************}
- c54,56
- a{****************************************************************************}
- c58,80
- a{****************************************************************************}
- c82,84
- a {****************************************************************************}
- c80,80
- c87,109
- a{*** D I S P L A Y M E T H O D S ***}
- c102,102
- a{****************************************************************************}
- c113,116
- a{****************************************************************************}
- c118,136
- a { Here we assume that the vertical units are either pixels }
- a { or lines }
- c134,134
- c140,141
- a { don't try to scroll if 1 line or }
- a { less is visible }
- c144,146
- a { set selStart to the bottom of the first selected line }
- c148,149
- a { set selEnd to the top of the last selected line }
- c151,157
- a IF vSpan <= 1 THEN { don't try to scroll if 1 line or }
- a EXIT(ScrollToSelection);{ less is visible }
- c146,146
- c161,176
- a{*** T E X T S P E C I F I C A T I O N M E T H O D S ***}
- c160,160
- a{****************************************************************************}
- c180,182
- a{****************************************************************************}
- c184,185
- a { Pascal string, so text starts at }
- a { byte one, and the number of }
- a { characters is in byte zero }
- c176,176
- c190,192
- a{****************************************************************************}
- c194,197
- a{****************************************************************************}
- c199,200
- a saveHState: SignedByte; { Original handle attributes }
- c176,176
- c185,185
- a { Save state of text handle }
- c176,176
- c206,206
- a { Lock text in place }
- c208,208
- a { Another method does the work }
- c189,189
- c211,211
- a { Restore state of text handle }
- c213,216
- a{****************************************************************************}
- c218,220
- a{****************************************************************************}
- aPROCEDURE CAbstractText.SetTextPtr (textPtr: Ptr; { Pointer to some text }
- a numChars: Longint); { Number of characters in the text }
- c203,203
- c225,227
- a{****************************************************************************}
- c229,236
- a{****************************************************************************}
- c238,242
- a{*** T E X T C H A R A C T E R I S T I C S M E T H O D S ***}
- c205,205
- a{****************************************************************************}
- c246,248
- a{****************************************************************************}
- c250,255
- a{****************************************************************************}
- c257,259
- a{****************************************************************************}
- c261,262
- a fontNum: Integer; { Corresponding font number }
- c224,224
- a { Call utility to look up number for }
- a { this font }
- c267,267
- a { Legal font numbers are positive }
- c269,273
- a{****************************************************************************}
- c275,277
- a{****************************************************************************}
- c279,283
- a{****************************************************************************}
- c285,287
- a{****************************************************************************}
- c289,293
- a{****************************************************************************}
- c295,297
- a{****************************************************************************}
- c299,303
- a{****************************************************************************}
- c305,309
- a{****************************************************************************}
- c311,315
- a{****************************************************************************}
- c317,322
- a{****************************************************************************}
- c324,328
- a{****************************************************************************}
- c330,334
- a{****************************************************************************}
- c336,340
- a{****************************************************************************}
- c342,344
- a{****************************************************************************}
- c346,350
- a{****************************************************************************}
- c352,354
- a{****************************************************************************}
- c356,360
- a{****************************************************************************}
- c362,365
- a{****************************************************************************}
- c367,371
- a{****************************************************************************}
- c373,376
- a{****************************************************************************}
- c378,383
- a{****************************************************************************}
- c385,396
- a{****************************************************************************}
- c398,404
- a{****************************************************************************}
- c406,408
- a{****************************************************************************}
- c410,415
- a{*** C A L I B R A T I N G M E T H O D S ***}
- c350,350
- a{****************************************************************************}
- c419,423
- a{****************************************************************************}
- c425,430
- a{****************************************************************************}
- c432,436
- a{****************************************************************************}
- c438,454
- a { use height of line 1 as height of all lines }
- c383,383
- c457,465
- a { find the line at top of frame }
- c467,470
- a { find the line at bottom of frame }
- c472,484
- a { we now know how many full lines will fit. resize the frame, }
- a { while ensuring that at least one line is visible }
- c415,415
- c488,501
- a{****************************************************************************}
- c503,506
- a{****************************************************************************}
- c508,512
- a{****************************************************************************}
- c514,520
- a{****************************************************************************}
- c522,526
- a{****************************************************************************}
- c528,530
- a{****************************************************************************}
- c532,536
- a{*** C O M M A N D M E T H O D S ***}
- c456,456
- a{****************************************************************************}
- c540,544
- a{****************************************************************************}
- c546,575
- a Assert(wantsClicks = TRUE);
- c577,585
- a Assert(wantsClicks = TRUE);
- c587,627
- a{****************************************************************************}
- c629,631
- a{****************************************************************************}
- c633,661
- a { The remaining menu updating involves style and formatting}
- a { commands. Don't do it if the text is not stylable.}
- c583,583
- c665,667
- a { Get selection returns the "current" text attributes. For }
- a { single-style text these are the global attributes and are }
- a { by definition always continous. For multi-style text, it }
- a { returns the attributes of the selections, and the returned }
- a { flags indicate which are continuous }
- c583,583
- c583,583
- c675,680
- a { lastFontNum is the last font number seen from UpdateMenus }
- a { lastFontCmd is the cmd # corresponding to lastFontNum }
- a { if lastFontNum == style.tsFont, then we don't need to }
- a { lookup the font name in the menu again }
- c583,583
- c686,696
- a { Font size of zero means the system default size,}
- a { but we need a real number for the size menu.}
- c593,593
- c700,702
- a { lastTextSize is the last text size seen from UpdateMenus }
- a { lastSizeCmd is the cmd # corresponding to lastFontNum }
- a { if lastTextSize == style.tsSize, then we don't need to }
- a { lookup the size in the menu again }
- c615,615
- c708,762
- a{****************************************************************************}
- c764,774
- a{****************************************************************************}
- c776,777
- a VAR macEvent: EventRecord);
- c779,787
- a { Don't try to insert any command keys into the text, }
- a { pass them along the command chain }
- c674,674
- c791,833
- a{****************************************************************************}
- c835,838
- a{****************************************************************************}
- c840,841
- a VAR macEvent: EventRecord);
- c762,762
- c784,784
- c845,849
- a{****************************************************************************}
- c851,854
- a{****************************************************************************}
- c856,861
- a{****************************************************************************}
- c863,866
- a{****************************************************************************}
- c868,899
- a{****************************************************************************}
- c901,904
- a{****************************************************************************}
- c906,913
- a{****************************************************************************}
- c915,917
- a{****************************************************************************}
- c919,923
- a{****************************************************************************}
- c925,927
- a{****************************************************************************}
- aPROCEDURE CAbstractText.AdjustCursor (where: Point; { Mouse location in Window coords }
- c930,934
- a{****************************************************************************}
- c936,938
- a{****************************************************************************}
- c940,944
- a{****************************************************************************}
- c946,948
- a{****************************************************************************}
- c950,954
- a{****************************************************************************}
- c956,958
- a{****************************************************************************}
- c960,964
- a{****************************************************************************}
- c966,970
- a{****************************************************************************}
- c972,982
- a { if the text is selectable, then it can be the gopher }
- c847,847
- c985,987
- a{****************************************************************************}
- c989,992
- a{****************************************************************************}
- c994,1000
- a{****************************************************************************}
- c1002,1004
- a{****************************************************************************}
- c1006,1010
- a{****************************************************************************}
- c1012,1015
- a{****************************************************************************}
- c1017,1021
- a{****************************************************************************}
- c1023,1025
- a{****************************************************************************}
- c1027,1033
- a{****************************************************************************}
- c1035,1037
- a{****************************************************************************}
- c1039,1050
- a{****************************************************************************}
- c1052,1054
- a{****************************************************************************}
- c1056,1062
- a{****************************************************************************}
- c1064,1067
- a{****************************************************************************}
- c1069,1084
- a newTask.ITextEditTask(self, editCmd, cFirstTaskIndex);
- c934,934
- c1087,1091
- a{****************************************************************************}
- c1093,1096
- a{****************************************************************************}
- c1098,1119
- a newTask.ITextStyleTask(self, styleCmd, taskIndex);
- c964,964
- c1087,1087
- c1123,1125
- a{****************************************************************************}
- c1127,1133
- a{****************************************************************************}
- c1135,1143
- a { nothing in this method moves memory }
- c1145,1151
- a { must use CharByte to get character. }
- a { CharByte does not move memory }
- c1000,1000
- c1155,1182
- a{****************************************************************************}
- c1184,1190
- a{****************************************************************************}
- c1192,1199
- a { nothing in this method moves memory }
- c1145,1145
- c1202,1208
- a { must use CharByte to get character. }
- a { CharByte does not move memory }
- c1050,1050
- c1212,1234
- a{****************************************************************************}
- c1236,1236
- a{****************************************************************************}
- c1238,1251
- a { force pageHeight to include only full lines }
- c1084,1084
- a { use height of line 1 as height of all lines }
- c1255,1258
- a { CPanorama will paginate into equal sized strips given }
- a { the new page height }
- c1261,1292
- e
- fCAppleEvent.p
- x283854181,383927741
- a{****************************************************************************}
- c1,12
- a{****************************************************************************}
- c14,22
- a{****************************************************************************}
- c24,32
- a{****************************************************************************}
- aPROCEDURE CAppleEvent.IAppleEvent (VAR aeEvent: AppleEvent;
- a VAR aeReply: AppleEvent;
- c36,38
- a self.theEvent := aeEvent;
- a self.theReply := aeReply;
- a self.theRefCon := aeRefCon;
- a self.eventClass := aeEventClass;
- a self.eventID := aeEventID;
- c44,46
- a { canInteract indicates whether user interaction has been}
- a { requested and approved.}
- c46,46
- c50,51
- a { errCode is used to store the error code ultimately}
- a { returned back to the AppleEvent mgr, which in turn will}
- a { pass it to the sender. It is initialized to errAEEventNotHandled}
- a { to indicate that the event has not yet been handled. If no object in}
- a { the chain of command handles an event, then errCode will}
- a { not be changed, and the sender will be informed that the}
- a { event wasn't handled.}
- c46,46
- c60,62
- a{****************************************************************************}
- c64,66
- a{****************************************************************************}
- c68,72
- a{****************************************************************************}
- c74,76
- a{****************************************************************************}
- c78,82
- a{****************************************************************************}
- c84,90
- a{****************************************************************************}
- c92,96
- a{****************************************************************************}
- c98,101
- a{****************************************************************************}
- c103,107
- a{****************************************************************************}
- c109,111
- a{****************************************************************************}
- c113,117
- a{****************************************************************************}
- c119,121
- a{****************************************************************************}
- c123,128
- a event := self.theEvent;
- c130,133
- a{****************************************************************************}
- c135,141
- a{****************************************************************************}
- c143,196
- a{****************************************************************************}
- c198,206
- a{****************************************************************************}
- c208,212
- a{****************************************************************************}
- c214,216
- a{****************************************************************************}
- c218,222
- a{****************************************************************************}
- c224,230
- a{****************************************************************************}
- c232,241
- a{****************************************************************************}
- c243,258
- a{****************************************************************************}
- c260,264
- a { Don't call AEInteractWithUser again if it has already been}
- a { requested and approved.}
- c222,222
- c268,269
- a IF (self.idleProc <> NIL) THEN
- a proc := self.idleProc
- c272,283
- e
- fCApplication.p
- x116835722,93277686
- a{****************************************************************************}
- c1,24
- a{****************************************************************************}
- c26,36
- a Devices, Fonts, GestaltEqu, LowMem, OSUtils, Traps, MethTableUtils, Script,
- a SegLoad, ToolUtils, PasLibIntf;
- c39,43
- a { make this visible to TCL.lib }
- c45,47
- a{$IFC MAC68K}
- c48,53
- c294,295
- a{*** I N I T I A L I Z A T I O N M E T H O D S ***}
- a{****************************************************************************}
- c58,60
- a{****************************************************************************}
- c54,55
- aPROCEDURE CApplication.IApplication (extraMasters: Integer; { Number of additional master }
- a { blocks to allocate }
- a aRainyDayFund: Longint;{ Bytes of memory to reserve for }
- a { a rainy day }
- c62,62
- a aCriticalBalance: Longint;{ Bytes to save for critical }
- a { operations }
- c62,62
- a aToolboxBalance: Longint); { Bytes to savefor the toolbox }
- c73,76
- a gApplication := self; { initialize the global pointer }
- c62,62
- a(* MenuDisable := LongPtr($B54); { Low-memory global }*)
- c80,81
- a { indicate initialization phase }
- c83,84
- a { Initialize Toolbox Managers }
- c86,87
- a { Fine tune the Memory Manager }
- c89,107
- a { We want an early first Idle }
- c109,110
- a { Initialize cMaxSleepTime to 10 seconds. This is an arbitrary}
- a { value which gives screen savers, clocks, etc. some time,}
- a { without stealing too much time from other processes.}
- a { Applications can override it by simply assigning a new value to it.}
- c94,94
- c116,117
- a { Cursors }
- c119,128
- a gGopher := self;
- c130,138
- a{****************************************************************************}
- c140,142
- a{****************************************************************************}
- c144,146
- a { Standard initialization calls }
- c133,133
- a InitGraf(@qd.thePort);
- c150,157
- a{****************************************************************************}
- c159,161
- a{****************************************************************************}
- aPROCEDURE CApplication.InitMemory (extraMasters: Integer; { Number of additional master }
- a { blocks to allocate }
- c133,133
- a aRainyDayFund: Longint;{ Bytes of memory to reserve for }
- a { a rainy day }
- c133,133
- a aCriticalBalance: Longint;{ Bytes to reserve for critical }
- a { operations }
- c133,133
- a aToolboxBalance: Longint); { Bytes to reserve for those toolbox }
- a { routines that don't fail gracefully }
- c133,133
- c145,145
- a Assert(aRainyDayFund >= aCriticalBalance);
- a Assert(aCriticalBalance >= aToolboxBalance);
- c136,136
- a { Grow heap to maximum size to }
- a MaxApplZone; { help prevent fragmentation }
- c136,136
- a { Call MoreMasters to allocate extra master pointers. }
- a { Experiment to determine how many master pointers the }
- a { application uses under session of heavy use. }
- c138,138
- c186,190
- a SetGrowZone(@GrowZoneFunc); { Traps out of memory conditions }
- c146,146
- c193,194
- a { Set instance variables }
- c196,203
- a rainyDay := NewHandleCanFail(rainyDayFund); { Reserve a block of memory }
- c205,208
- a{****************************************************************************}
- c210,212
- a{****************************************************************************}
- c165,165
- c215,220
- a{$IFC MAC68K}
- c221,226
- c294,294
- c207,207
- c228,233
- a {
- c235,235
- a origETS := Longint(NGetTrapAddress(trap, ToolTrap));
- a NSetTrapAddress(UniversalProcPtr(@ETS_Patch), trap, ToolTrap);
- c238,238
- a origLoadSeg := Longint(NGetTrapAddress(trap, ToolTrap));
- a NSetTrapAddress(UniversalProcPtr(@LoadSeg_Patch), trap, ToolTrap);
- a }
- c185,185
- c207,208
- a{****************************************************************************}
- c245,247
- a{****************************************************************************}
- c192,192
- c250,253
- a {
- c254,256
- a NSetTrapAddress(UniversalProcPtr(origETS), trap, ToolTrap);
- c258,258
- a NSetTrapAddress(UniversalProcPtr(origLoadSeg), trap, ToolTrap);
- c260,260
- a }
- c207,208
- a{****************************************************************************}
- c264,272
- a{****************************************************************************}
- c274,278
- a { example of referencing classes used only with NewByName }
- c280,291
- a { etc... }
- c293,297
- a{****************************************************************************}
- c299,301
- a{****************************************************************************}
- c303,308
- a gSystem.hasGestalt := TrapAvailable(_Gestalt);
- c310,311
- a gSystem.scriptsInstalled := 1; { assume only Roman script }
- c249,249
- c314,340
- a ELSE { If we don't have Gestalt, then we can't have any System 7 features }
- c316,316
- c343,347
- a gSystem.scriptsInstalled := GetScriptManagerVariable(smEnabled);
- c326,327
- c296,297
- a{****************************************************************************}
- c354,359
- a{****************************************************************************}
- c291,291
- c362,363
- a { Use a standard Desktop }
- c291,291
- c366,366
- a gDesktop.IDesktop(self);
- c296,297
- a{****************************************************************************}
- c371,373
- a{****************************************************************************}
- c375,376
- a { Use standard Clipboard }
- c378,378
- a gClipboard.IClipboard(self, TRUE);
- c351,352
- a{****************************************************************************}
- c383,387
- a{****************************************************************************}
- c389,390
- a { Use standard Decorator }
- c392,395
- a{****************************************************************************}
- c397,400
- a{****************************************************************************}
- c402,410
- a{****************************************************************************}
- c412,415
- a{****************************************************************************}
- c350,350
- c418,423
- a{****************************************************************************}
- c425,428
- a{****************************************************************************}
- c430,434
- a{****************************************************************************}
- c436,438
- a{****************************************************************************}
- c440,441
- a {* Get File Parameters *}
- c352,352
- a sfNumTypes := -1; { Display all files }
- a sfFileTypes[0] := '????'; { Just put something here }
- a sfFileFilter := NIL; { No extra filtering of files }
- a sfGetDLOGHook := NIL; { No special handling of items }
- a sfGetDLOGid := getDlgID; { Use built-in get dialog box }
- a sfGetDLOGFilter := NIL; { No special event processing }
- c361,361
- c368,369
- a{****************************************************************************}
- c454,456
- a{****************************************************************************}
- c458,460
- a AppendResMenu(GetMenuHandle(MENUapple), 'DRVR');
- c462,464
- a{*** A C T I O N M E T H O D S ***}
- c365,365
- c369,369
- a{****************************************************************************}
- c469,470
- a{A subordinate is notifying the Application that a task has been completed . }
- a{****************************************************************************}
- aPROCEDURE CApplication.Notify (theTask: CTask); { The completed task }
- c369,369
- c376,376
- c476,480
- a{****************************************************************************}
- c482,485
- a{****************************************************************************}
- aPROCEDURE CApplication.DoKeyDown (theChar: Char; { The associated character }
- a keyCode: Byte; { Code for the associated key }
- a VAR macEvent: EventRecord);{ Key down event record }
- c390,390
- c381,381
- a { Null Method }
- c394,395
- a{****************************************************************************}
- c496,498
- a{****************************************************************************}
- aPROCEDURE CApplication.DoAutoKey (theChar: Char; { The associated character }
- a keyCode: Byte; { Code for the associated key }
- a VAR macEvent: EventRecord);{ auto key event record }
- c390,390
- c395,395
- a { Null Method }
- c394,395
- a{****************************************************************************}
- c509,511
- a{****************************************************************************}
- aPROCEDURE CApplication.DoKeyUp (theChar: Char; { The associated character }
- a keyCode: Byte; { Code for the associated key }
- a VAR macEvent: EventRecord);{ Key up event record }
- c405,405
- c395,395
- a { Null Method }
- c409,410
- a{****************************************************************************}
- c522,526
- a{****************************************************************************}
- aPROCEDURE CApplication.DoCommand (theCommand: Longint); { Command number }
- c403,403
- a theDA: Str255; { Name of Desk Accessory to open }
- a macSFReply: SFReply; { Standard File reply record }
- c532,535
- a { Open a DA or launch another }
- a { application under MultiFinder }
- c538,539
- a GetMenuItemText(GetMenuHandle(MENUapple), LoWord(-theCommand), theDA);
- c541,575
- a{****************************************************************************}
- c577,579
- a{****************************************************************************}
- c450,450
- c582,587
- a { Is the frontmost window modal? }
- c589,615
- a{*** M E M O R Y M A N A G E M E N T ***}
- c493,494
- a{****************************************************************************}
- c620,623
- a{****************************************************************************}
- c491,491
- c626,630
- a{****************************************************************************}
- c632,637
- a{****************************************************************************}
- c639,641
- a self.inCriticalOperation := fInCriticalOperation;
- c506,507
- a{****************************************************************************}
- c646,661
- a{****************************************************************************}
- c663,670
- a { Try to release some memory }
- c672,673
- a { See how much we still need }
- c675,677
- a BEGIN { Hooray! Enough memory was freed! }
- a GrowMemory := GROW_SUCCESS; { Let's get out of here }
- c680,707
- a { We have enough savings to cover }
- a { the request and maintain our }
- a { minimum balance }
- c711,715
- a DisposeHandle(rainyDay);
- c717,722
- a gSleepTime := 0; { Idle as soon as possible }
- a rainyDayUsed := TRUE; { We've tapped the rainy day fund }
- c703,703
- c575,575
- c575,575
- c608,608
- c729,734
- a { Requestor is prepared for failure }
- c736,738
- a { Try the last resort}
- c740,744
- a{****************************************************************************}
- c746,760
- a{****************************************************************************}
- c762,763
- a { Null Method }
- c618,618
- c617,618
- a{****************************************************************************}
- c769,775
- a{****************************************************************************}
- c777,778
- a { Null Method }
- c629,630
- a{****************************************************************************}
- c783,790
- a{****************************************************************************}
- c792,798
- a{*** E X E C U T I O N M E T H O D S ***}
- c640,640
- a{****************************************************************************}
- c802,804
- a{****************************************************************************}
- c644,644
- a {)
- c808,808
- a{ }
- c810,825
- a {)
- c827,833
- a{ }
- c835,843
- a { now that an exception handler is posted, }
- a { mark the application as running }
- c846,847
- a REPEAT { Continuously poll for events }
- a { and respond to them }
- c699,699
- c851,852
- a UNTIL NOT running; { Until flag is turned off }
- c699,699
- c699,699
- a phase := appQuitting; { exception handler is about to be removed, }
- a { mark the app as quitting. }
- c858,862
- a{****************************************************************************}
- c864,866
- a{****************************************************************************}
- c868,882
- a { Is a DA the front window? }
- c884,889
- a { A user command may have initiated a }
- a { critical operation, e.g. Save, but }
- a { it is complete once the event is handled}
- c726,726
- c894,895
- a { any temporary allocations should have been}
- a { released by now.}
- c726,726
- c899,905
- a { Carry out urgent chores }
- c726,726
- c908,911
- a { Check for context-switch with }
- a { Desk Accessories }
- c727,727
- c915,941
- a{****************************************************************************}
- c943,946
- a{****************************************************************************}
- c948,949
- a openOrPrint: Integer; { Type of action requested }
- a numPreloads: Integer; { No. of files to process }
- a i: Integer; { Index for files }
- a macAppFile: AppFile; { Info about a file }
- a macSFReply: SFReply; { Standard File info record }
- c763,763
- a { Check if files were selected }
- c765,765
- a{$IFC MAC68K}
- c958,959
- a { Process files one by one }
- c765,765
- c962,968
- a { Get info about the file }
- c781,781
- c971,972
- a { Copy info into a Standard File }
- a { record }
- c781,781
- c976,980
- a { Automatically open selected file }
- c794,794
- c983,985
- a { User wants to print Document }
- c987,989
- a { We've processed this file }
- c991,995
- a { Perform start up action }
- c997,997
- c294,294
- c796,797
- a{****************************************************************************}
- c1002,1008
- a{****************************************************************************}
- c1010,1015
- a { TCL 1.1 - only do cmdNew if there are no AppleEvents.}
- a { If there are, we anticipate getting the open app event}
- a { Under the THINK Pascal environment, we don't get an }
- a { initial oapp. We use the compiler variable TCL_DEBUG }
- a { to determine if we're running the debug version. }
- a { If we are, we don't wait for the oapp event. }
- c818,818
- c1023,1032
- a{****************************************************************************}
- c1034,1037
- a{****************************************************************************}
- c1039,1042
- a { We are going into the background }
- c1044,1048
- a{****************************************************************************}
- c1050,1052
- a{****************************************************************************}
- c1054,1056
- a { Do nothing if a DA is in front }
- c1058,1064
- a{****************************************************************************}
- c1066,1068
- a{****************************************************************************}
- c1070,1071
- a LMSetCurDeactive(WindowRef(0));
- c1073,1075
- a{****************************************************************************}
- c1077,1079
- a{****************************************************************************}
- c1081,1082
- a LMSetCurActivate(WindowRef(0));
- c1084,1087
- a{****************************************************************************}
- c1089,1093
- a{****************************************************************************}
- c1095,1099
- a { Assume we will stop running }
- c1101,1102
- a { (Does not include floating }
- a { windows or DAs) }
- c880,880
- c1106,1110
- a { Tell window's Director to quit }
- a { If Quit method returns FALSE, }
- a { abort the quit sequence }
- c885,885
- c1115,1116
- a { User still wants to run program }
- c1118,1126
- a{****************************************************************************}
- c1128,1130
- a{****************************************************************************}
- c1132,1133
- a{ NULL Method }
- c934,935
- a{****************************************************************************}
- c1138,1145
- a{****************************************************************************}
- c1147,1149
- a {)
- c1151,1155
- a{ }
- c1157,1159
- a{ }
- c935,935
- a Failure(kSilentErr, 0); { kSilentErr inhibits the error alert }
- c934,935
- a{*** D O C U M E N T H A N D L I N G M E T H O D S ***}
- c935,935
- a{****************************************************************************}
- c1168,1171
- a{****************************************************************************}
- c1173,1175
- a { NULL Method }
- c934,935
- a{****************************************************************************}
- c1180,1184
- a{****************************************************************************}
- c1186,1188
- a { NULL Method }
- c999,1000
- c957,957
- a{****************************************************************************}
- c1194,1197
- a{****************************************************************************}
- c1199,1200
- a corner: Point; { Top left corner of dialog box }
- c1202,1203
- a { Center dialog box on the screen }
- c957,957
- c1206,1207
- a SFPGetFile(corner, '', sfFileFilter, sfNumTypes, @sfFileTypes, sfGetDLOGHook, macSFReply, sfGetDLOGid, sfGetDLOGFilter);
- c1209,1211
- a{*** C H O R E H A N D L I N G M E T H O D S ***}
- c959,959
- c961,961
- a{****************************************************************************}
- c1216,1220
- a{****************************************************************************}
- aPROCEDURE CApplication.Idle (VAR macEvent: EventRecord); { Usually a null or system event }
- c1011,1011
- a grow: Longint; { Amount heap may be grown }
- c1225,1237
- a { Memory reserve needs to be }
- a { replenished }
- c980,980
- c1059,1059
- c1242,1243
- a { Enough memory has been freed }
- c992,992
- c1246,1247
- a DisposeHandle(rainyDay);
- c989,989
- c1250,1256
- a { Inform user of memory shortage }
- c998,998
- c1259,1262
- a { Idle time for objects in the }
- a { active chain of command }
- c1000,1000
- a { Run thru the chain of command }
- a { Start at the bottom }
- c1015,1015
- c1269,1272
- a { Let bureaucrat kill some time }
- c1015,1015
- c1275,1277
- a { Move up to his/her boss }
- c1279,1280
- a { Until end of command chain }
- c1282,1283
- a { Carry out assigned chores }
- c1015,1015
- c1286,1289
- a{****************************************************************************}
- c1291,1294
- a{****************************************************************************}
- c1296,1299
- a { Force immediate idle }
- c1301,1303
- a{****************************************************************************}
- c1305,1308
- a{****************************************************************************}
- c1310,1315
- a{****************************************************************************}
- c1317,1321
- a{****************************************************************************}
- c1323,1329
- a{****************************************************************************}
- c1331,1334
- a{****************************************************************************}
- c1336,1340
- a{****************************************************************************}
- c1342,1344
- a{****************************************************************************}
- c1346,1395
- a { event was handled successfully}
- c1114,1114
- c1398,1403
- a{****************************************************************************}
- c1405,1410
- a{****************************************************************************}
- aFUNCTION CApplication.PackageAppleEvent (VAR theEvent: AppleEvent;
- a VAR theReply: AppleEvent;
- c1414,1424
- a{****************************************************************************}
- c1426,1428
- a{****************************************************************************}
- c1149,1149
- c1431,1467
- a { if we're still running then Quit didn't succeed }
- a { but we don't know what error to report! }
- c1188,1188
- c1471,1477
- e
- fCArray.p
- x429612522,57456986
- a{****************************************************************************}
- c1,10
- a{****************************************************************************}
- c12,24
- a Assert((index > 0) & (index <= numItems));
- c26,32
- a{****************************************************************************}
- c34,38
- a{****************************************************************************}
- c40,41
- a { Initialize superclass }
- c43,52
- a{****************************************************************************}
- c54,56
- a{****************************************************************************}
- c58,59
- a { Free handle to items }
- c61,61
- a { Pass message on to superclass }
- c63,66
- a{****************************************************************************}
- c68,71
- a{****************************************************************************}
- c73,75
- a { Set instance variable }
- c77,79
- a{****************************************************************************}
- c81,85
- a{****************************************************************************}
- c87,96
- a{****************************************************************************}
- c98,100
- a{****************************************************************************}
- c102,108
- a{****************************************************************************}
- c110,113
- a{****************************************************************************}
- c115,121
- a{****************************************************************************}
- c123,125
- a{****************************************************************************}
- c127,133
- a{****************************************************************************}
- c135,142
- a{****************************************************************************}
- c144,147
- a Assert(index > 0);
- a Assert(lockChanges = FALSE);
- c129,129
- c151,153
- a { Check if we need more space }
- c155,157
- a { Move items at position >= index }
- a { down one slot, unless it is }
- a { the last item }
- c133,133
- c162,166
- a { There's another item in the list }
- c168,169
- a { Stick new object in the empty slot}
- c171,175
- a{****************************************************************************}
- c177,181
- a{****************************************************************************}
- c183,187
- a Assert(lockChanges = FALSE);
- c157,157
- c190,192
- a { We're gonna get rid of an item }
- c194,195
- a { Shift items following the object }
- a { to remove up one slot, thereby }
- a { overwriting it }
- c161,161
- c200,202
- a { The number of free slots is }
- a { greater than the blockSize. }
- a { Reduce the size of the items }
- a { handle. }
- c169,169
- c208,212
- a{****************************************************************************}
- c214,216
- a{****************************************************************************}
- c218,219
- a { Be sure to take the scratch }
- a { element storage at the end }
- a { of the handle into account when }
- a { resizing the item handle }
- c224,228
- a{****************************************************************************}
- c230,232
- a{****************************************************************************}
- c234,238
- a{****************************************************************************}
- c240,244
- a{****************************************************************************}
- c246,255
- a { In order to move the item, we must first make a copy of it. }
- a { Since the items could be of any size, we keep storage for }
- a { exactly one item at the end of the items handle. In order }
- a { to guard against the two methods simultaneously using the }
- a { temporary buffer, we mark it in use by setting the }
- a { usingTemporary instance variable. }
- c207,207
- c263,265
- a { Element is before target location}
- a { Shift items between current }
- a { and target locations down one }
- c269,272
- a { Element is after target location }
- a { Shift items between target and }
- a { current locations up one }
- c276,277
- a { copy element into new position }
- c279,286
- a{****************************************************************************}
- c288,292
- a{****************************************************************************}
- c294,302
- a{****************************************************************************}
- c304,311
- a{****************************************************************************}
- c313,339
- a{****************************************************************************}
- c341,344
- a{****************************************************************************}
- c346,356
- a{****************************************************************************}
- c358,360
- a{****************************************************************************}
- c362,364
- a Assert(usingTemporary = FALSE);
- c302,302
- c367,370
- a{****************************************************************************}
- c372,374
- a{****************************************************************************}
- c376,377
- a Assert(usingTemporary = TRUE);
- c302,302
- c380,383
- a{****************************************************************************}
- c385,387
- a{****************************************************************************}
- c389,394
- a{****************************************************************************}
- c396,398
- a{****************************************************************************}
- c400,410
- a { if copying the item handle failed, then we should }
- a { kill the copy created by CObject.Copy. We clear the }
- a { item handle so disposing of the copy doesn't dispose }
- a { of the array's item handle. }
- c335,335
- c416,442
- e
- fCBartender.p
- x526322301,214403095
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,30
- a{**************************************************}
- c32,35
- a{**************************************************}
- c37,74
- a theEntry.inMenuBar := TRUE; { mark menu as installed in menu bar . }
- c76,100
- a{*** I N S E R T I O N / D E L E T I O N M E T H O D S ***}
- c98,100
- a{**************************************************}
- c106,110
- a{**************************************************}
- c104,104
- c113,144
- a theMenus^^[i].inMenuBar := TRUE; { mark menu as installed }
- c146,154
- a{**************************************************}
- c156,160
- a{**************************************************}
- c153,153
- c163,173
- a { release commands handle }
- c175,184
- a{**************************************************}
- c186,190
- a{**************************************************}
- c181,181
- c193,198
- a{**************************************************}
- c200,203
- a{**************************************************}
- c192,192
- c206,215
- a DeleteMenu(MENUid); { Remove menu from the menu bar }
- a forceMBarUpdate := TRUE; { must redraw menu bar }
- a menuIndex := FindMenuIndex(MENUid); { find menu in table }
- c219,221
- a theMenus^^[menuIndex].inMenuBar := FALSE; { mark menu as not in menu bar }
- c223,234
- a{**************************************************}
- c236,242
- a{**************************************************}
- c225,225
- c245,257
- a macMenu := GetMenuHandle(hMENUid);
- c244,244
- c260,270
- a macMenu := GetMenuHandle(inMENUid);
- c272,280
- a{*** I T E M M A N I P U L A T I O N M E T H O D S ***}
- c259,259
- c259,259
- c259,259
- a{**************************************************}
- c286,289
- a{**************************************************}
- c265,265
- c292,304
- a{**************************************************}
- c306,309
- a{**************************************************}
- c282,282
- c312,324
- a{**************************************************}
- c326,331
- a{**************************************************}
- c303,303
- c334,345
- a BEGIN { Make sure menu is installed }
- a { and not already enabled }
- a EnableItem(macMenu, 0); { Item 0 means the menu as a whole }
- a DeleteFromBar(NOTHING); { Force redraw of menu bar }
- c350,353
- a{**************************************************}
- c355,359
- a{**************************************************}
- c324,324
- c362,366
- a macMenu := GetMenuHandle(MENUid); { Get associated Toolbox record }
- c368,374
- a{****************************************************************************}
- c376,378
- a{****************************************************************************}
- c340,340
- c381,393
- a{****************************************************************************}
- c395,397
- a{****************************************************************************}
- c399,412
- a{**************************************************}
- c414,417
- a{**************************************************}
- c377,377
- c420,429
- a SetMenuItemText(macMenu, itemNo, theText);
- c393,393
- c396,396
- c396,396
- a{**************************************************}
- c435,438
- a{**************************************************}
- c396,396
- c441,450
- a GetMenuItemText(macMenu, itemNo, theText);
- c411,412
- c412,412
- a{**************************************************}
- c456,461
- a{**************************************************}
- c419,419
- c464,478
- a{** I T E M I N S E R T I O N / D E L E T I O N M E T H O D S **}
- c432,433
- c432,432
- a{**************************************************}
- c484,488
- a{**************************************************}
- c440,440
- c491,514
- a InsertMenuItem(theMenus^^[i].macMenu, theText, afterItem);
- c463,463
- c517,542
- a{**************************************************}
- c544,547
- a{**************************************************}
- c498,498
- c550,565
- a DeleteMenuItem(macMenu, itemNo); { Remove item from Mac menu }
- c511,511
- c568,582
- a{** L O O K - U P M E T H O D S **}
- c527,527
- c527,527
- c529,529
- a{**************************************************}
- c588,591
- a{**************************************************}
- c533,533
- c594,610
- a{**************************************************}
- c612,616
- a{**************************************************}
- c556,556
- c619,635
- a{**************************************************}
- c637,641
- a{**************************************************}
- c580,580
- c644,670
- a{**************************************************}
- c672,676
- a{**************************************************}
- c618,618
- c679,717
- a{**************************************************}
- c719,723
- a{**************************************************}
- c665,665
- c726,743
- a GetMenuItemText(macMenu, i, testStr);
- c678,678
- c746,761
- a{*** C O M M A N D E X T R A C T I O N ***}
- c695,695
- c695,695
- c695,695
- a{**************************************************}
- c767,772
- a{**************************************************}
- c716,716
- c775,792
- a GetMenuItemText(theEntry.macMenu, itemNo, itemStr);
- c794,795
- a SetMenuItemText(theEntry.macMenu, itemNo, itemStr);
- c754,754
- c798,802
- a{**************************************************}
- c804,808
- a{**************************************************}
- c810,842
- a{**************************************************}
- c844,848
- a{**************************************************}
- c774,774
- c851,878
- a{** I T E M D I M M I N G / E N A B L I N G M E T H O D S **}
- c801,802
- c812,812
- a{**************************************************}
- c884,895
- a{**************************************************}
- c820,820
- c898,910
- a{**************************************************}
- c912,917
- a{**************************************************}
- c840,840
- c920,932
- a{**************************************************}
- c934,938
- a{**************************************************}
- c856,856
- c941,1004
- a{****************************************************************************}
- c1006,1011
- a{****************************************************************************}
- c927,927
- c1014,1029
- a numMenus := self.numMenus;
- c1031,1037
- a { can't leave here, because we still need to update }
- a { the lastEnable flag for each menu. }
- c979,980
- c997,997
- c1043,1047
- e
- fCBureaucrat.p
- x514627345,189747433
- a{**************************************************}
- c1,18
- a{**************************************************}
- c20,32
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c31,32
- c34,34
- a{**************************************************}
- c38,41
- a{**************************************************}
- c43,49
- a{**************************************************}
- c51,54
- a{**************************************************}
- c49,49
- c57,60
- a IF gGopher = self THEN
- c62,67
- a{*** A C C E S S I N G M E T H O D S ***}
- c65,67
- a{**************************************************}
- c73,76
- a{**************************************************}
- c67,67
- c79,85
- a{*** C O M M A N D I N G M E T H O D S ***}
- c78,78
- c78,78
- c78,78
- a{**************************************************}
- c91,95
- a{**************************************************}
- c83,83
- c98,106
- a{**************************************************}
- c108,111
- a{**************************************************}
- c97,97
- c114,115
- a VAR macEvent: EventRecord);
- c117,123
- a{**************************************************}
- c125,128
- a{**************************************************}
- c113,113
- c131,132
- a VAR macEvent: EventRecord);
- c117,119
- c137,140
- a{**************************************************}
- c142,146
- a{**************************************************}
- c130,130
- c149,150
- a VAR macEvent: EventRecord);
- c134,136
- c155,158
- a{**************************************************}
- c160,190
- a{**************************************************}
- c192,200
- a{**************************************************}
- c202,210
- a{**************************************************}
- c192,192
- c213,217
- a{**************************************************}
- c219,222
- a{**************************************************}
- c196,196
- c225,229
- a{****************************************************************************}
- c231,235
- a{****************************************************************************}
- c212,212
- c238,242
- a gSleepTime := 0; { force immediate idle }
- c244,245
- a IF (gGopher <> self) THEN
- c247,248
- a gGopher := self;
- c216,216
- a { can't set new gopher if previous gopher }
- a { refuses to resign }
- c217,217
- c254,256
- a BecomeGopher := FALSE; { failed }
- c258,267
- a BecomeGopher := TRUE; { success }
- c269,270
- a{****************************************************************************}
- c272,275
- a{****************************************************************************}
- c237,237
- c278,281
- a itsSupervisor.ProviderChanged(self, reason, info);
- c242,242
- c284,287
- a{****************************************************************************}
- c289,291
- a{****************************************************************************}
- c250,250
- c294,302
- a{****************************************************************************}
- c304,306
- a{****************************************************************************}
- c270,270
- c309,316
- e
- fCChore.p
- x160907416,228016032
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,25
- a{**************************************************}
- c27,33
- a{**************************************************}
- c35,40
- e
- fCClipboard.p
- x381876976,446628050
- a{****************************************************************************}
- c1,25
- a{****************************************************************************}
- c27,32
- a TCL, Scrap;
- c31,31
- c35,36
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c34,34
- c36,36
- a{****************************************************************************}
- c41,43
- a{****************************************************************************}
- aPROCEDURE CClipboard.IClipboard (aSupervisor: CApplication; { Boss in chain of command }
- a hasWindow: Boolean); { Can contents be displayed? }
- c47,50
- a { Initialize superclass }
- c52,56
- a itsWindow.IWindow(WIND_CLIPBOARD, FALSE, gDesktop, self);
- c58,60
- a itsScrollPane.IScrollPane(itsWindow, self, 0, 0, 0, 0, sizELASTIC, sizELASTIC, TRUE, TRUE, TRUE);
- c62,73
- a{****************************************************************************}
- c75,80
- a{****************************************************************************}
- c82,83
- a { Copy private scrap to the global }
- a { one if necessary }
- c86,92
- a { Hide Clipboard window }
- c94,102
- a{****************************************************************************}
- c104,107
- a{****************************************************************************}
- c109,113
- a { If global scrap changed, we must }
- a { update our private one if the }
- a { Clipboard window is visible. }
- a { No need to convert when the }
- a { Clipboard window is hidden; we }
- a { can wait for a Paste. This way }
- a { we avoid having to convert if }
- a { the user never uses it. }
- a { before we were suspended }
- a { was active before suspending }
- c102,102
- c125,130
- a { Show window if it was visible }
- c132,134
- a { Activate Clipboard window if it }
- a { was active }
- c137,144
- a{****************************************************************************}
- c146,149
- a{****************************************************************************}
- c151,158
- a { Close Clipboard window }
- c160,161
- a { Clipboard never cancels a close }
- c163,165
- a{****************************************************************************}
- c167,171
- a{****************************************************************************}
- c173,176
- a { Hide but do NOT dispose }
- c178,181
- a { Toggle text to "Hide Clipboard" }
- c183,186
- a{****************************************************************************}
- c188,191
- a{****************************************************************************}
- c193,198
- a { Hide the Clipboard window }
- c160,160
- c201,201
- a ELSE { Show the Clipboard window }
- c198,198
- a { Update private scrap if global }
- a { is more recent }
- c206,210
- a { Clipboard window is the front, }
- a { active window }
- c213,216
- a { Toggle text to "Show Clipboard" }
- c218,226
- a{****************************************************************************}
- c228,230
- a{****************************************************************************}
- aPROCEDURE CClipboard.PutGlobalScrap (theType: ResType; { Resource type of the data }
- c233,234
- a saveHState: SignedByte; { Original handle attributes }
- a errCode: Longint; { Mac error code }
- c237,238
- a { Save state of data handle }
- c240,240
- a { Lock data in place }
- c242,244
- a { Restore state of data handle }
- c246,249
- a { In the event that PutGlobalScrap is being called without }
- a { a user cut or copy, we need to call SystemEdit so the }
- a { clipboard works properly. }
- c216,216
- c254,262
- a{****************************************************************************}
- c264,267
- a{****************************************************************************}
- aFUNCTION CClipboard.GetGlobalScrap (theType: ResType; { Resource type of the data }
- c270,271
- a length: Longint; { Amount of data or error code }
- a offset: Longint; { Offset from start of scrap }
- c238,238
- a { Read from the desk scrap }
- c216,216
- c277,277
- a { Save in case someone wants this }
- a { information }
- c280,281
- a { Check for an error }
- c283,284
- a { No data found }
- a { Finding no data of the specified }
- a { type does not warrant an error }
- a { message }
- c289,294
- a { Data successfully retrieved }
- c223,223
- c297,299
- a{****************************************************************************}
- c301,304
- a{****************************************************************************}
- c306,307
- a theScrapInfo: PScrapStuff;
- c238,238
- c310,310
- a { Private scrap has changed }
- c244,244
- c313,315
- a { Get info about global scrap }
- c244,244
- c318,325
- a{****************************************************************************}
- c327,329
- a{****************************************************************************}
- c331,332
- a theScrapInfo: PScrapStuff;
- c274,274
- a { Get info about global scrap }
- c336,340
- a{****************************************************************************}
- c342,346
- a{****************************************************************************}
- c348,349
- a { Null Method }
- c298,299
- a{****************************************************************************}
- c354,359
- a{****************************************************************************}
- c361,362
- a { Null Method }
- c298,299
- a{ Resource type of the data }
- a{****************************************************************************}
- c368,376
- a{****************************************************************************}
- aPROCEDURE CClipboard.PutData (theType: ResType; { Resource type of the data }
- c379,386
- a{ Create space for the data }
- a{ Kill the data handle }
- a{****************************************************************************}
- c390,396
- a{****************************************************************************}
- aFUNCTION CClipboard.GetData (theType: ResType;
- c399,403
- a { Data successfully retrieved }
- c405,407
- a { Some kind of error occurred }
- c312,312
- a DisposeHandle(theData);
- c411,411
- a { Signal failure }
- c413,416
- a{****************************************************************************}
- c418,423
- a{****************************************************************************}
- c325,325
- c426,438
- a{****************************************************************************}
- c440,443
- a{****************************************************************************}
- c445,450
- a{****************************************************************************}
- c452,456
- a{****************************************************************************}
- c458,489
- a{****************************************************************************}
- c491,493
- a{****************************************************************************}
- c495,499
- a{****************************************************************************}
- c501,506
- a{****************************************************************************}
- c508,512
- a{****************************************************************************}
- c514,518
- a{****************************************************************************}
- c409,409
- c521,546
- a pict.IPicture(itsScrollPane, self, 1, 1, 0, 0, sizELASTIC, sizELASTIC);
- c548,554
- a text.IEditText(itsScrollPane, self, 1, 1, 0, 0, sizELASTIC, sizELASTIC, 1000);
- c556,559
- a { CEditText makes its own copy. }
- c561,561
- a DisposeHandle(dataHandle);
- c486,486
- c564,564
- a { we didn't make a view, kill the data }
- c534,534
- c450,450
- c568,572
- e
- fCCluster.p
- x242636483,328758261
- a{****************************************************************************}
- c1,17
- a{****************************************************************************}
- c19,28
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c28,28
- a{****************************************************************************}
- c32,34
- a{****************************************************************************}
- c36,37
- a { Initialize superclass }
- c39,41
- a { set the items handle to be a copy of CArray.hItems }
- a { This helps to be compatible with existing subclasses }
- a { of CCluster and also lets us optimize certain things }
- a { because we know the item handle is really an array }
- a { of object references. }
- c39,39
- c48,50
- a{****************************************************************************}
- c52,54
- a{****************************************************************************}
- c56,58
- a { Dispose of the Cluster itself }
- a self.Free;
- c49,50
- a{****************************************************************************}
- c64,67
- a{****************************************************************************}
- c69,79
- a { Clear reference to disposed item }
- c81,83
- a { notify dependents }
- c75,75
- c86,90
- a { There are too many free slots }
- c75,75
- c93,96
- a{****************************************************************************}
- c98,100
- a{****************************************************************************}
- aPROCEDURE CCluster.Add (theObject: CObject); { Object to add }
- c83,83
- c104,109
- a{ Search items for this object }
- a{****************************************************************************}
- c112,114
- a{****************************************************************************}
- aPROCEDURE CCluster.Remove (theObject: CObject); { Object to remove }
- c117,117
- a i: Longint; { Offset of object in cluster }
- c104,104
- c120,126
- a{****************************************************************************}
- c128,130
- a{****************************************************************************}
- aFUNCTION CCluster.Includes (theObject: CObject): Boolean; { Object to check for inclusion }
- c104,104
- a { Object is in the cluster if the }
- a { Offset is NOT BAD_INDEX }
- c103,103
- c137,139
- a{ Function pointer }
- a{****************************************************************************}
- c142,144
- a{****************************************************************************}
- c146,172
- a{****************************************************************************}
- c174,177
- a{****************************************************************************}
- c179,206
- a{****************************************************************************}
- c208,211
- a{****************************************************************************}
- c213,243
- a{****************************************************************************}
- c245,248
- a{****************************************************************************}
- c250,283
- a{****************************************************************************}
- c285,288
- a{****************************************************************************}
- aFUNCTION CCluster.Offset (theObject: CObject): Longint; { Object to search for }
- c253,253
- c258,258
- a i: Longint; { Running index into the cluster }
- c258,258
- c265,265
- c272,272
- c297,305
- a Offset := BAD_INDEX; { search failed }
- c281,282
- a{****************************************************************************}
- c310,313
- a{****************************************************************************}
- c315,325
- e
- fCCollaborator.p
- x2900935,319870401
- a{****************************************************************************}
- c1,13
- a{****************************************************************************}
- c15,24
- a{****************************************************************************}
- c26,29
- a{****************************************************************************}
- c31,37
- a{****************************************************************************}
- c39,43
- a{****************************************************************************}
- c45,47
- a aProvider.AddDependent(self);
- c49,50
- a{****************************************************************************}
- c52,56
- a{****************************************************************************}
- c58,61
- a aProvider.RemoveDependent(self);
- c63,64
- a{****************************************************************************}
- c66,68
- a{****************************************************************************}
- c70,83
- a{****************************************************************************}
- c85,88
- a{****************************************************************************}
- c90,96
- a{****************************************************************************}
- c98,100
- a{****************************************************************************}
- c102,114
- a{****************************************************************************}
- c116,118
- a{****************************************************************************}
- c120,127
- a{****************************************************************************}
- c129,135
- a{****************************************************************************}
- c137,143
- a aDependent.ProviderChanged(self, reason, info);
- c145,148
- a { We allow the senders of BroadcastChange to pass NULL for info }
- a { However, assuming dereferencing NIL is bad, it easier for }
- a { receivers of ProviderChanged if dereferencing info is always }
- a { safe. Therefore, when info is NIL, we substitute of pointer }
- a { to 0 }
- c141,141
- c155,164
- a{****************************************************************************}
- c166,169
- a{****************************************************************************}
- c171,175
- a { null method, subclasses override }
- c164,164
- c154,154
- a{****************************************************************************}
- c180,184
- a{****************************************************************************}
- c186,189
- a aDependent.RemoveProvider(self);
- c191,194
- a aProvider.RemoveDependent(self);
- c191,192
- c175,175
- c199,212
- e
- fCCollection.p
- x177629848,311847080
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,25
- a{**************************************************}
- c27,30
- a{**************************************************}
- c32,38
- a{**************************************************}
- c40,43
- a{**************************************************}
- c45,51
- a{**************************************************}
- c53,56
- a{**************************************************}
- c50,50
- c59,64
- e
- fCControl.p
- x55362800,499728718
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,26
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c25,26
- c28,28
- a{**************************************************}
- c32,34
- a{**************************************************}
- c36,44
- a{*** A C C E S S I N G M E T H O D S ***}
- c42,44
- a{**************************************************}
- c50,53
- a{**************************************************}
- c47,47
- c56,58
- a SetControlValue(macControl, aValue); { Set value with Toolbox call }
- c55,55
- c61,64
- a{**************************************************}
- c66,69
- a{**************************************************}
- c60,60
- c72,73
- a GetValue := GetControlValue(macControl); { Return value from Toolbox call }
- c75,77
- a{**************************************************}
- c79,82
- a{**************************************************}
- c71,71
- c85,87
- a SetControlMaximum(macControl, aMaxValue); { Set value with Toolbox call }
- c75,77
- a{**************************************************}
- c93,96
- a{**************************************************}
- c84,84
- c99,100
- a GetMaxValue := GetControlMaximum(macControl); { Return value from Toolbox call}
- c89,91
- a{**************************************************}
- c106,109
- a{**************************************************}
- c91,91
- c112,114
- a SetControlMinimum(macControl, aMinValue); { Set value with Toolbox call }
- c102,104
- a{**************************************************}
- c120,123
- a{**************************************************}
- c103,103
- c126,127
- a GetMinValue := GetControlMinimum(macControl); { Return value from Toolbox call}
- c116,118
- a{**************************************************}
- c133,136
- a{**************************************************}
- c117,117
- c139,141
- a SetControlTitle(macControl, aTitle);
- c116,118
- a{**************************************************}
- c147,150
- a{**************************************************}
- c125,125
- c153,154
- a GetControlTitle(macControl, aTitle);
- c129,131
- a{**************************************************}
- c160,179
- a{**************************************************}
- c152,152
- aPROCEDURE CControl.SetActionProc (anActionProc: ControlActionUPP);
- c154,154
- a SetControlAction(macControl, anActionProc);
- c156,158
- c157,157
- a{*** M A N I P U L A T I N G M E T H O D S ***}
- c157,158
- c157,157
- a{**************************************************}
- c194,197
- a{**************************************************}
- c181,181
- c200,218
- a{**************************************************}
- c220,223
- a{**************************************************}
- c186,186
- c226,244
- a{**************************************************}
- c246,249
- a{**************************************************}
- c212,212
- c252,266
- a FrameToWindR(aperture, tempRect); { Draw active control }
- c268,274
- a{**************************************************}
- c276,279
- a{**************************************************}
- c238,238
- c282,302
- a{**************************************************}
- c304,310
- a{**************************************************}
- c266,266
- c313,340
- a{**************************************************}
- c342,348
- a{**************************************************}
- c302,302
- c351,380
- a{*** D R A W I N G M E T H O D S ***}
- c339,340
- c339,339
- a{**************************************************}
- c386,389
- a{**************************************************}
- c340,340
- c392,430
- a{**************************************************}
- c432,435
- a{**************************************************}
- c437,437
- aPROCEDURE CControl.DrawAll (VAR area: Rect); { Portion which must be drawn }
- c439,445
- a BEGIN { Control Manager works in Window }
- a { coordinates }
- c396,396
- c449,456
- a { temporarily change the control's port so it draws to }
- a { the printer rather than onscreen }
- c418,418
- a macControl^^.contrlOwner := qd.thePort;
- c453,453
- c462,466
- a{**************************************************}
- c468,474
- a{**************************************************}
- c418,418
- c477,478
- a wAperture: Rect; { Aperture in Window coords }
- c442,442
- a cPreparedView := self;
- c419,419
- c483,486
- a SetPort(macPort); { Use the Port of this Control }
- a SetOrigin(0, 0); { Must use origin of (0, 0) }
- c429,429
- a { Set clipping region to the }
- a FrameToWindR(aperture, wAperture); { Control's aperture expressed }
- a ClipRect(wAperture); { in Window coordinates }
- c427,427
- c429,429
- c495,495
- a itsEnvironment.Restore; { Restore its drawing environment }
- c428,429
- a{****************************************************************************}
- c500,502
- a{****************************************************************************}
- c444,444
- c505,510
- a { get the clipping rectangle in Window coordinates }
- c444,444
- c513,528
- a{*** C L I C K R E S P O N S E M E T H O D S ***}
- c459,459
- c459,459
- c459,459
- a{**************************************************}
- c534,539
- a{**************************************************}
- c466,466
- c542,562
- a IF whichPart >= kControlIndicatorPart THEN
- c564,566
- a origValue := GetControlValue(macControl);
- c494,494
- c569,575
- a delta := GetControlValue(macControl) - origValue;
- c577,600
- a{**************************************************}
- c602,607
- a{**************************************************}
- c530,530
- c610,614
- a{**************************************************}
- c616,621
- a{**************************************************}
- c541,541
- c624,628
- a{****************************************************************************}
- c630,635
- a{****************************************************************************}
- c637,648
- e
- fCDataFile.p
- x326169527,198871083
- a{****************************************************************************}
- c1,20
- a{****************************************************************************}
- c22,31
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c31,31
- a{****************************************************************************}
- c35,37
- a{****************************************************************************}
- c39,44
- a{*** A C C E S S I N G M E T H O D S ***}
- c44,44
- a{****************************************************************************}
- c48,51
- a{****************************************************************************}
- c53,57
- a{****************************************************************************}
- c59,62
- a{****************************************************************************}
- c64,71
- a{****************************************************************************}
- c73,81
- a{****************************************************************************}
- c83,89
- a{****************************************************************************}
- c91,95
- a{****************************************************************************}
- c97,104
- a{*** O P E N / C L O S E M E T H O D S ***}
- c104,104
- a{****************************************************************************}
- c108,110
- a{****************************************************************************}
- c112,123
- a{****************************************************************************}
- c125,127
- a{****************************************************************************}
- c129,136
- a { clear refnum before closing file, in case it fails }
- c138,144
- a{*** R E A D / W R I T E M E T H O D S ***}
- c126,126
- a{ Length of file in bytes }
- a{****************************************************************************}
- c149,152
- a{****************************************************************************}
- c154,181
- a{****************************************************************************}
- c183,188
- a{****************************************************************************}
- c190,196
- a{****************************************************************************}
- c198,201
- a{****************************************************************************}
- c203,208
- a { Number of bytes to write out }
- c210,211
- a { Move mark to beginning of file }
- c213,214
- a { Write out all the data }
- c216,217
- a { Set file length in case previous }
- a { contents was bigger }
- c220,221
- a { Force write to disk }
- c223,226
- a{****************************************************************************}
- c228,231
- a{****************************************************************************}
- c233,240
- e
- fCDecorator.p
- x128424624,93015358
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,27
- a{**************************************************}
- c29,32
- a{**************************************************}
- c34,41
- a wWidth := qd.screenBits.bounds.right - qd.screenBits.bounds.left - hLocation - RIGHT_SMARGIN - (MAX_WOFFSETS - 1) * HORIZ_WOFFSET;
- c41,41
- a wHeight := qd.screenBits.bounds.bottom - qd.screenBits.bounds.top - vLocation - BOTTOM_SMARGIN - (MAX_WOFFSETS - 1) * VERT_WOFFSET;
- c45,46
- a{**************************************************}
- c48,50
- a{**************************************************}
- c46,46
- c53,70
- a{**************************************************}
- c72,76
- a{**************************************************}
- c78,86
- a{**************************************************}
- c88,91
- a{**************************************************}
- c83,83
- c94,104
- a { normal non-modal windows will be centered both horizontally and }
- a { vertically. However, modal windows, e.g. modal dialogs, should }
- a { be placed in the top 1/3 of the main screen. }
- c93,93
- c109,139
- a WITH qd.screenBits.bounds DO
- c141,149
- a{**************************************************}
- c151,154
- a{**************************************************}
- c139,139
- c157,162
- e
- fCDesktop.p
- x513848663,329187339
- a{****************************************************************************}
- c1,22
- a{****************************************************************************}
- c24,29
- a TCL, CWindow, LowMem;
- c28,28
- c32,35
- a Script;
- c33,33
- c38,40
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c37,37
- a{****************************************************************************}
- c44,46
- a{****************************************************************************}
- c42,42
- aPROCEDURE CDesktop.IDesktop (aSupervisor: CBureaucrat); { Supervisor in the command chain }
- c50,52
- a { Initialize superclass }
- c54,54
- a { Allocate space for a QD port }
- c56,57
- a { Initialize QuickDraw port }
- c59,60
- a { Make the port rectangle coincide with the bounding box of }
- a { the gray region (entire screen excluding the menu bar). Also }
- a { adjust the origin so that the local coords of this port are }
- a { the same as global coords. }
- c57,57
- c66,70
- a { Make the clipping and visible }
- a { regions same as the grayRgn }
- c73,78
- a { Initialize our window list }
- c80,85
- a{****************************************************************************}
- c87,89
- a{****************************************************************************}
- c91,95
- a DisposePtr(Ptr(macPort));
- c97,101
- a{****************************************************************************}
- c103,107
- a{****************************************************************************}
- c100,100
- aPROCEDURE CDesktop.DispatchClick (VAR macEvent: EventRecord); { Mouse down event record }
- c111,111
- a thePart: Integer; { Location of mouse click }
- a macWindow: WindowPtr; { Window where click occurred }
- a theWindow: CWindow; { Corresponding window object }
- c115,125
- a { Check for any click the could potentially deactivate a window }
- a { that wants to be modal. Menu bar clicks are OK because }
- a { menus should be accessible from modal dialogs. }
- c100,100
- c130,144
- a { Click on insignificant area of }
- a { the Desktop }
- c125,125
- a CountClicks(self, macEvent);
- c149,151
- a inMenuBar: { Selection from a menu }
- c144,144
- c154,156
- a { A selection was made. Execute }
- a { the corresponding command. }
- c159,159
- a { Unhighlight the menu title }
- c161,165
- a { Click inside a DA window }
- c129,129
- c168,174
- a { This is an inactive window or }
- a { an underlying floater }
- c141,141
- c178,179
- a { Exit here unless window want to }
- a { responding to the click. }
- c182,184
- a ELSE { process activating click }
- c186,189
- a { Window handles clicks. Make sure }
- a { all windows are updated before }
- a { responding to the click }
- c147,147
- c194,197
- a { Window ignores clicks. Handle }
- a { same as a click on the desktop }
- c163,163
- a CountClicks(self, macEvent);
- c202,219
- a{****************************************************************************}
- c221,223
- a{****************************************************************************}
- c174,174
- aPROCEDURE CDesktop.DoMouseUp (VAR macEvent: EventRecord); { Mouse up event record }
- c177,177
- c228,228
- a { Null Method }
- c218,219
- c183,183
- a{****************************************************************************}
- c234,236
- a{****************************************************************************}
- aPROCEDURE CDesktop.DispatchCursor (where: Point; { Mouse location in Global coords }
- a mouseRgn: RgnHandle); { Region containing the mouse }
- c183,183
- c241,242
- a macWindow: WindowPtr; { Window containing the mouse }
- a theWindow: CWindow; { Corresponding window object }
- a thePart: Integer; { Part of window containing mouse }
- c246,250
- a { Do nothing if we are not the }
- a { foreground process }
- a { or the cursor is hidden }
- c193,193
- a IF gInBackground THEN
- c256,261
- a { Determine which window contains }
- a { the mouse }
- c200,200
- c265,267
- a { Mouse is within the content }
- a { region of a window. Check if }
- a { that window is active. }
- c206,206
- c272,277
- a { Window containing the mouse is }
- a { active. Tell it to adjust the }
- a { cursor shape. }
- c281,282
- a { cursor over inactive window }
- c284,288
- a { Use arrow cursor in menu bar }
- a SetCursor(qd.arrow);
- a mbarRect := qd.screenBits.bounds;
- c292,296
- a { All checks have failed. Mouse is }
- a { in some insignificant area of }
- a { the Desktop }
- c300,306
- a{****************************************************************************}
- c308,311
- a{****************************************************************************}
- c232,232
- aPROCEDURE CDesktop.AdjustCursor (where: Point; { Mouse location in global coords }
- a mouseRgn: RgnHandle); { Region containing the mouse }
- c241,241
- c317,319
- a SetCursor(qd.arrow);
- c321,322
- a { A Window is active, so subtract }
- a { its content region from the }
- a { desktop }
- c326,329
- a { There's no active window, so }
- a { cursor has the same shape over }
- a { the entire desktop }
- c247,247
- c334,337
- a{****************************************************************************}
- c339,341
- a {****************************************************************************}
- c254,254
- c344,353
- a{****************************************************************************}
- c355,358
- a{****************************************************************************}
- c271,271
- c361,373
- a{****************************************************************************}
- c375,377
- a {****************************************************************************}
- c379,390
- a{****************************************************************************}
- c392,394
- a{ {****************************************************************************}
- c304,304
- c397,410
- a{****************************************************************************}
- c412,414
- a {****************************************************************************}
- c318,318
- c417,422
- a{****************************************************************************}
- c424,426
- a{****************************************************************************}
- c333,333
- aPROCEDURE CDesktop.AddWind (theWindow: CWindow); { Window object to add }
- c345,345
- c431,435
- a{****************************************************************************}
- c437,439
- a{****************************************************************************}
- c337,337
- aPROCEDURE CDesktop.RemoveWind (theWindow: CWindow); { Window object to remove }
- c345,345
- c444,444
- a { Hide window before removing it }
- c446,451
- a{ regular window }
- a{)
- c454,454
- a{ }
- a{****************************************************************************}
- c457,459
- a{****************************************************************************}
- c352,352
- aPROCEDURE CDesktop.SelectWind (theWindow: CWindow); { Window to select }
- c352,352
- c364,364
- c465,466
- a { This is already the top window }
- c356,356
- c469,470
- a { A DA is on top }
- a { Make this the active window }
- c358,358
- c474,475
- a ELSE { This is not the current top one }
- c366,366
- c478,479
- a { Move this one to the front }
- c481,489
- a { Deactivate the former top }
- c491,494
- a { Mark it as the top regular }
- c496,504
- a{****************************************************************************}
- c506,508
- a{****************************************************************************}
- c510,513
- a { Make window visible }
- c515,520
- a { Deactivate former top window }
- c522,522
- a { There may be a new top window }
- a { Activate this window }
- c525,530
- a{ Set internal flag so our new top }
- a{ window will become active if }
- a{ the DA quits }
- a{ Our new top window needs to be }
- a{ activated }
- a{****************************************************************************}
- c537,539
- a{****************************************************************************}
- aPROCEDURE CDesktop.HideWind (theWindow: CWindow); { Window to hide }
- c511,511
- c543,548
- a { This was the top window }
- a { Find the new top top window }
- c551,554
- a { A DA is now on top }
- c556,556
- a LMSetCurActivate(WindowRef(frontWind));
- c558,568
- a{****************************************************************************}
- c570,572
- a{****************************************************************************}
- aPROCEDURE CDesktop.DragWind (theWindow: CWindow; { Window to drag }
- a VAR macEvent: EventRecord); { Associated mouse down event }
- c511,511
- c577,578
- a { For an underlying window, bring }
- a { it to the front (unless the }
- a { command key is down) before }
- a { dragging it }
- c583,586
- a { Let user drag window, but leave }
- a { a margin so window doesn't get }
- a { dragged too far off the screen }
- c441,441
- c591,596
- a{****************************************************************************}
- c598,600
- a{****************************************************************************}
- c602,606
- a{****************************************************************************}
- c608,611
- a{****************************************************************************}
- c613,614
- a { Return instance variable }
- c616,618
- a{ Return copy of instance variable }
- a{****************************************************************************}
- c621,623
- a{****************************************************************************}
- c625,629
- a{****************************************************************************}
- c631,633
- a {****************************************************************************}
- c635,639
- a{****************************************************************************}
- c641,644
- a {****************************************************************************}
- c646,651
- a{****************************************************************************}
- c653,656
- a{****************************************************************************}
- c658,664
- a{****************************************************************************}
- c666,668
- a{ {****************************************************************************}
- c670,675
- a{**************************************************}
- c677,680
- a{**************************************************}
- c528,528
- c683,686
- a{**************************************************}
- c688,691
- a{**************************************************}
- c528,528
- c694,700
- e
- fCDirector.p
- x509919902,400700206
- a{****************************************************************************}
- c1,22
- a{****************************************************************************}
- c24,32
- a{****************************************************************************}
- c34,39
- a{****************************************************************************}
- c41,43
- a { Initialize Superclass }
- c45,46
- a aSupervisor.AddDirector(self);
- a { No window yet }
- c49,49
- a { Can't be active with no window }
- c51,51
- a { Make self Gopher upon activate }
- a itsGopher := self;
- c46,46
- c55,58
- a{****************************************************************************}
- c60,62
- a {****************************************************************************}
- c64,67
- a CDirectorOwner(itsSupervisor).RemoveDirector(self);
- c69,71
- a{****************************************************************************}
- c73,75
- a {****************************************************************************}
- c77,88
- a{****************************************************************************}
- c90,92
- a {****************************************************************************}
- c94,101
- a{****************************************************************************}
- c103,105
- a{****************************************************************************}
- c107,110
- a { Turn on active flag }
- c112,112
- a { Set the gopher unless its window }
- a { floats }
- c115,121
- a CDirectorOwner(itsSupervisor).ActivateDirector(self);
- c100,101
- a{****************************************************************************}
- c126,128
- a{****************************************************************************}
- c130,133
- a { Turn off active flag }
- c135,135
- a { Inactive Director can't be the }
- a { gopher }
- a IF (gGopher = self) THEN
- c116,116
- c140,143
- a CDirectorOwner(itsSupervisor).DeactivateDirector(self);
- c123,124
- a{****************************************************************************}
- c148,150
- a{****************************************************************************}
- c152,154
- a { If director is currently active }
- c132,133
- c158,159
- a { Visually deactivate its window }
- a { This has the side effect of }
- a { deactivating the Director also }
- c163,163
- a { Restore active flag so Director }
- a { will reactivate when the }
- a { application resumes }
- c167,172
- a{****************************************************************************}
- c174,176
- a{****************************************************************************}
- c178,180
- a { If we were active before suspend }
- c156,157
- c184,185
- a { We're not really active yet }
- c187,187
- a { Visually activate window }
- c189,194
- a{****************************************************************************}
- c196,198
- a{****************************************************************************}
- c172,172
- c201,201
- aFUNCTION CDirector.Close (quitting: Boolean): Boolean; { Is this part of a quit sequence? }
- c203,213
- a { if we're already in the middle of processing a Close }
- a { message then we just return failure for the new one. }
- c172,172
- c217,222
- a { use an exception handler to reset the alreadyClosing }
- a { flag if an exception occurs. }
- c194,194
- c226,237
- a Free; { Closing means Disposing }
- c192,192
- c194,194
- c241,244
- a{****************************************************************************}
- c246,251
- a{****************************************************************************}
- c253,267
- a{****************************************************************************}
- c269,271
- a{****************************************************************************}
- c273,277
- a{****************************************************************************}
- c279,281
- a{****************************************************************************}
- c283,287
- a{****************************************************************************}
- c289,291
- a{****************************************************************************}
- c293,296
- a CDirectorOwner(itsSupervisor).ActivateDirector(self);
- c243,244
- a{****************************************************************************}
- c301,303
- a{****************************************************************************}
- c305,308
- a CDirectorOwner(itsSupervisor).DeactivateDirector(self);
- c266,267
- a{****************************************************************************}
- c313,315
- a{****************************************************************************}
- c317,321
- a{****************************************************************************}
- c323,325
- a{****************************************************************************}
- c265,265
- c328,332
- a{****************************************************************************}
- c334,336
- a{****************************************************************************}
- c277,277
- c339,346
- a{****************************************************************************}
- c348,352
- a{****************************************************************************}
- c287,287
- c355,362
- a { When a bureaucrat becomes the gopher, it automatically }
- a { sends the bureaucratIsGopher update to all its dependents }
- a { and up the chain of command. When a director receives this }
- a { update, the bureacrat could be a pane in the director's }
- a { window, a subdirector, a subdirector's window, a pane in }
- a { a subdirector's window, or potentially any other bureaucrat }
- a { the application may have placed in the chain of command. }
- a { }
- a { The purpose of itsGopher is to "remember" which bureaucrat }
- a { is supposed to become the gopher when the director's window }
- a { is made active. Since subdirectors have their own itsGopher,}
- a { and we don't want to set the gopher to panes in windows that}
- a { aren't active, we must filter out bureaucrats that we don't }
- a { want itsGopher to point to. }
- c294,294
- c378,379
- a { itsGopher shouldn't be a subdirector }
- a { don't change itsGopher }
- c382,384
- a { itsGopher should only reference panes in the }
- a { directors window(s). }
- c299,299
- c388,390
- a ELSE { this is some other bureaucrat }
- c392,397
- a{****************************************************************************}
- c399,402
- a{****************************************************************************}
- c311,311
- c405,406
- a OwnsWindow := (aWindow <> NIL) & (aWindow.GetSupervisor = self);
- c321,321
- c320,321
- a{****************************************************************************}
- c412,413
- a{****************************************************************************}
- c321,321
- c416,421
- a ignore := self.Close(kNotQuitting);
- c331,332
- c332,332
- c426,426
- e
- fCDirectorOwner.p
- x247856157,409201631
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,22
- a{****************************************************************************}
- c24,26
- a{****************************************************************************}
- c28,33
- a{****************************************************************************}
- c35,37
- a{****************************************************************************}
- c39,52
- a{****************************************************************************}
- c54,56
- a{****************************************************************************}
- c58,68
- a{****************************************************************************}
- c70,73
- a{****************************************************************************}
- c75,81
- a{****************************************************************************}
- c83,85
- a{****************************************************************************}
- c87,92
- a{****************************************************************************}
- c94,96
- a{****************************************************************************}
- c98,99
- a {)
- c101,101
- a{ }
- c103,113
- a {)
- c115,115
- a{ }
- c99,99
- a{****************************************************************************}
- c119,121
- a{****************************************************************************}
- c107,107
- c124,132
- a { Tell all directors we are back }
- a { in control }
- c135,138
- a{****************************************************************************}
- c140,142
- a{****************************************************************************}
- c144,148
- a{****************************************************************************}
- c150,153
- a{****************************************************************************}
- c155,169
- a { removing last director might dispose}
- a { the list}
- c172,179
- a{****************************************************************************}
- c181,183
- a{****************************************************************************}
- c185,194
- e
- fCDocument.p
- x385061706,488063920
- a{****************************************************************************}
- c1,22
- a{****************************************************************************}
- c24,29
- a TCL, Printing;
- c28,28
- c32,33
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c31,31
- c33,33
- a{****************************************************************************}
- c38,44
- a{****************************************************************************}
- c46,46
- a printable: Boolean); { Is document printable? }
- c48,51
- a { Initialize superclass }
- c53,81
- a{****************************************************************************}
- c83,85
- a{****************************************************************************}
- c87,94
- a{****************************************************************************}
- c96,98
- a{****************************************************************************}
- c100,110
- a{****************************************************************************}
- c112,114
- a{****************************************************************************}
- c116,121
- a ignore := self.Close(FALSE);
- c110,110
- c124,134
- a IF (CautionAlert(ALRTrevert, NIL) = ok) THEN
- c136,160
- a{****************************************************************************}
- c162,164
- a{****************************************************************************}
- c166,191
- a{****************************************************************************}
- c193,195
- a{****************************************************************************}
- aFUNCTION CDocument.Close (quitting: Boolean): Boolean; { Is this part of a quit sequence? }
- c198,200
- a { Is it OK to close document? }
- c202,203
- a { Yes. Close associated file. }
- c205,208
- a { Document has been closed }
- c210,212
- a { User does not want to close }
- a { the Document }
- c215,218
- a{****************************************************************************}
- c220,223
- a{****************************************************************************}
- c225,228
- a{****************************************************************************}
- c230,233
- a{****************************************************************************}
- c235,239
- a{ Closing Window closes Document }
- a{****************************************************************************}
- c242,246
- a{****************************************************************************}
- c248,254
- a{*** P R I N T I N G M E T H O D S ***}
- c228,228
- a{****************************************************************************}
- c258,260
- a{****************************************************************************}
- c262,282
- a{****************************************************************************}
- c284,288
- a{****************************************************************************}
- c290,305
- a{****************************************************************************}
- c307,315
- a{****************************************************************************}
- c317,326
- a { firstPage must be less than or }
- a { equal to lastPage. Swap values }
- a { otherwise. }
- c330,335
- a { Can't print more pages than are }
- a { contained in the document }
- c338,344
- a{****************************************************************************}
- c346,352
- a{****************************************************************************}
- c319,319
- c355,363
- a{****************************************************************************}
- c365,367
- a{****************************************************************************}
- c326,326
- c370,377
- a{*** F I L I N G M E T H O D S ***}
- c344,344
- a{****************************************************************************}
- c381,384
- a{****************************************************************************}
- c344,344
- c387,388
- a { Null Method }
- c343,344
- a{****************************************************************************}
- c393,396
- a{****************************************************************************}
- c398,400
- a { Null Method }
- c362,363
- a{****************************************************************************}
- c405,408
- a{****************************************************************************}
- c410,414
- a{****************************************************************************}
- c416,420
- a{****************************************************************************}
- c422,423
- a macSFReply: SFReply; { Standard File reply record }
- c371,371
- a { Let user enter a file name }
- c427,432
- a ELSE { User cancelled SaveAs dialog box }
- c373,373
- c435,441
- a{****************************************************************************}
- c443,446
- a{****************************************************************************}
- c448,449
- a corner: Point; { Top left corner of dialog box }
- a origName: Str255; { Default name for file }
- a prompt: StringHandle; { Prompt string }
- c388,388
- c386,386
- a { Center dialog box on the screen }
- c456,465
- a{****************************************************************************}
- c467,470
- a{****************************************************************************}
- c472,481
- a { If Document has changed ... }
- c483,489
- a index := strQUITTING
- c491,491
- a index := strCLOSING;
- c438,438
- c494,495
- a { Ask user if s/he want to save }
- c497,503
- a { Save Document before closing it }
- c505,508
- a { Abort the close }
- c510,511
- a { If answer is NO, we don't need }
- a { to do anything here }
- c514,516
- a{****************************************************************************}
- c518,520
- a{****************************************************************************}
- c522,523
- a { 1st choice: name of its file }
- c525,526
- a { 2nd choice: name of its window }
- c528,529
- a { 3rd choice: NULL string }
- c531,534
- a{****************************************************************************}
- c536,539
- a{****************************************************************************}
- c541,563
- a{****************************************************************************}
- c565,568
- a{****************************************************************************}
- c570,577
- a ignore := itsPrinter.IPrinter(self, NIL);
- c515,516
- c493,493
- c582,582
- e
- fCEditText.p
- x66371549,386097490
- a{****************************************************************************}
- c1,33
- a{****************************************************************************}
- c35,40
- a TCL, Scrap;
- c39,39
- c43,50
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c48,48
- a{****************************************************************************}
- c54,56
- a{****************************************************************************}
- c58,72
- a{****************************************************************************}
- c74,76
- a{****************************************************************************}
- c78,86
- a{*** M O U S E A N D K E Y S T R O K E M E T H O D S ***}
- a{****************************************************************************}
- c89,91
- a{****************************************************************************}
- c93,94
- a macFontInfo: FontInfo; { Info about size of font }
- a clickLoopUPP: TEClickLoopUPP;
- c96,98
- a { Create the TE record }
- c100,101
- a { OK to just call GetFontInfo here }
- a { since the new TE Record uses }
- a { the same font characteristics }
- a { as the current port }
- c106,114
- c118,118
- a clickLoopUPP := NewTEClickLoopProc(@TEClickLoop);
- a TESetClickLoop(clickLoopUPP, macTE);
- c116,121
- a{****************************************************************************}
- c123,125
- a{****************************************************************************}
- aPROCEDURE CEditText.DoClick (hitPt: Point; { Mouse location in Frame coords }
- a modifierKeys: Integer; { State of modifier keys }
- a when: Longint); { Tick time of mouse click }
- c130,149
- a IF (NOT editable) & (gGopher = self) THEN
- c151,157
- a{****************************************************************************}
- c159,161
- a{****************************************************************************}
- c163,167
- a { check whether the char will exceed TE capacity }
- c143,143
- c170,177
- a{****************************************************************************}
- c179,185
- a{****************************************************************************}
- c187,200
- a { check for available memory, but only for insertions}
- a { of more than one character}
- c177,177
- c204,208
- a DisposeHandle(h);
- c210,212
- a{****************************************************************************}
- c214,217
- a{****************************************************************************}
- c219,223
- a gEditText := self;
- c211,212
- a{****************************************************************************}
- c228,231
- a{****************************************************************************}
- c233,241
- a{****************************************************************************}
- c243,246
- a{****************************************************************************}
- c248,264
- a{****************************************************************************}
- c266,268
- a{****************************************************************************}
- c270,274
- a { Must make sure that the }
- a { current selection is not }
- a { hilited on the print out }
- c260,260
- c279,285
- a{****************************************************************************}
- c287,289
- a{****************************************************************************}
- c291,293
- a { TCL 1.1: call CalcTERects rather than setting }
- a { the viewRect directly }
- c296,300
- a { Restore active state }
- c302,306
- a{****************************************************************************}
- c308,310
- a{****************************************************************************}
- c312,322
- a{=============================================================================}
- c324,326
- a{ =============================================================================}
- c328,342
- a{****************************************************************************}
- c344,346
- a{****************************************************************************}
- c348,361
- a{****************************************************************************}
- c363,365
- a{****************************************************************************}
- c367,368
- a { Get rid of TextEdit record }
- c370,371
- a { Pass message on to superclass }
- c373,375
- a{*** D I S P L A Y M E T H O D S ***}
- c322,322
- a{****************************************************************************}
- c379,381
- a{****************************************************************************}
- c383,384
- a macTE^^.inPort := qd.thePort;
- c386,389
- a{****************************************************************************}
- c391,393
- a{****************************************************************************}
- c395,407
- a{*** P R I N T I N G M E T H O D S ***}
- c361,361
- a{****************************************************************************}
- c411,413
- a{****************************************************************************}
- c415,420
- a { Must change the port in the TE }
- a { record to the current port, }
- a { which will be a printer port }
- a { page. It will be restored by }
- a { the DonePrinting() method. }
- a macTE^^.inPort := qd.thePort;
- c427,442
- a{*** T E X T S P E C I F I C A T I O N M E T H O D S ***}
- c375,375
- a{****************************************************************************}
- c446,449
- a{****************************************************************************}
- c451,453
- a { Stuff the text in the Mac TE record }
- c455,456
- a { Draw the new text }
- c458,460
- a{****************************************************************************}
- c462,464
- a{****************************************************************************}
- c466,470
- a{*** T E X T C H A R A C T E R I S T I C S M E T H O D S ***}
- c407,407
- c407,407
- a{****************************************************************************}
- c475,477
- a{****************************************************************************}
- c479,480
- a macFontInfo: FontInfo; { Info about size of font }
- c401,401
- c483,493
- a{****************************************************************************}
- c495,497
- a{****************************************************************************}
- c499,507
- a { Toggle style characteristic }
- c442,442
- c428,428
- c511,522
- a{****************************************************************************}
- c524,526
- a{****************************************************************************}
- c528,535
- a{****************************************************************************}
- c537,539
- a{****************************************************************************}
- c541,546
- a{****************************************************************************}
- c548,550
- a{****************************************************************************}
- c552,553
- a TESetAlignment(anAlignment, macTE);
- c489,489
- c469,470
- a{****************************************************************************}
- c559,561
- a{****************************************************************************}
- c563,581
- a{****************************************************************************}
- c583,585
- a{****************************************************************************}
- c587,588
- a macFontInfo: FontInfo; { Info about size of font }
- a extra: Integer; { Extra space between lines }
- c502,502
- c592,623
- a{****************************************************************************}
- c625,630
- a{****************************************************************************}
- c632,638
- a { Get info about font }
- c640,642
- a{*** C A L I B R A T I N G M E T H O D S ***}
- c546,546
- a{****************************************************************************}
- c646,651
- a{****************************************************************************}
- c653,675
- a{****************************************************************************}
- c677,687
- a{****************************************************************************}
- c689,698
- a{****************************************************************************}
- c700,704
- a{****************************************************************************}
- c706,728
- a{****************************************************************************}
- c730,736
- a{****************************************************************************}
- c738,772
- a{****************************************************************************}
- c774,776
- a{****************************************************************************}
- c778,782
- a{****************************************************************************}
- c784,788
- a{****************************************************************************}
- c790,797
- a{****************************************************************************}
- c799,801
- a{****************************************************************************}
- c803,811
- a{****************************************************************************}
- c813,815
- a{****************************************************************************}
- c817,822
- a{ TE line count is not correct if }
- a{ last char is a carriage return }
- a{****************************************************************************}
- c826,828
- a{****************************************************************************}
- c830,844
- a{****************************************************************************}
- c846,848
- a{****************************************************************************}
- c850,855
- a{****************************************************************************}
- c857,860
- a{****************************************************************************}
- c862,870
- a{****************************************************************************}
- c872,875
- a{****************************************************************************}
- c877,881
- a Assert(theOffset <= MAXINT);
- c866,866
- c884,887
- a{****************************************************************************}
- c889,891
- a{****************************************************************************}
- c893,909
- a{****************************************************************************}
- c911,915
- a{****************************************************************************}
- c917,949
- a{****************************************************************************}
- c951,953
- a{****************************************************************************}
- c955,966
- e
- fCEnvironment.p
- x455575167,522683783
- a{**************************************************}
- c1,14
- a{**************************************************}
- c16,27
- a{**************************************************}
- c29,33
- a{**************************************************}
- c35,41
- e
- fCError.p
- x423105361,267450719
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,24
- a{**************************************************}
- c26,31
- a{**************************************************}
- c33,58
- a IF StopAlert(ALRTsevereErr, NIL) = cancel THEN
- c60,71
- a{**************************************************}
- c73,83
- a{**************************************************}
- c85,111
- a{**************************************************}
- c113,117
- a{**************************************************}
- c110,110
- c120,133
- a{**************************************************}
- c135,141
- a{**************************************************}
- c132,132
- c144,212
- a left := (qd.screenBits.bounds.right - (right - left)) DIV 2;
- a top := (qd.screenBits.bounds.bottom - (bottom - top)) DIV 3;
- c202,202
- c216,233
- a DisposeDialog(theDialog);
- c235,239
- e
- fCFile.p
- x283253580,268535356
- a{****************************************************************************}
- c1,19
- a{****************************************************************************}
- c21,30
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- a{****************************************************************************}
- c33,35
- a{****************************************************************************}
- c37,38
- a { Clear instance variables }
- c40,44
- a{ Close Mac File }
- a{****************************************************************************}
- c47,49
- a{****************************************************************************}
- c51,53
- a INHERITED Free; { Pass message on to superclass }
- c55,56
- a{****************************************************************************}
- c58,60
- a{****************************************************************************}
- c62,63
- a { Null Method }
- c55,56
- a{*** S P E C I F Y I N G M E T H O D S ***}
- a{****************************************************************************}
- c69,71
- a{****************************************************************************}
- c73,74
- a{ Null Method }
- c66,66
- c65,66
- a{****************************************************************************}
- c80,82
- a{****************************************************************************}
- c84,93
- a{****************************************************************************}
- c95,97
- a{****************************************************************************}
- c99,108
- a{****************************************************************************}
- c110,112
- a{****************************************************************************}
- c114,125
- a{****************************************************************************}
- c127,129
- a{****************************************************************************}
- c131,141
- a{****************************************************************************}
- c143,148
- a{****************************************************************************}
- c150,163
- a { copy back specification}
- c165,170
- a { raise exception if this is a directory, we only handle files}
- c172,175
- a{*** A C C E S S I N G M E T H O D S ***}
- c168,168
- a{****************************************************************************}
- c179,181
- a{****************************************************************************}
- c183,187
- a{****************************************************************************}
- c189,191
- a{****************************************************************************}
- c193,202
- a{*** F I L I N G M E T H O D S ***}
- c173,173
- c173,173
- a{****************************************************************************}
- c207,209
- a{****************************************************************************}
- a PROCEDURE CFile.CreateNew (creator: OSType; { Creator signature }
- a fType: OSType); { File type }
- c175,175
- c184,184
- c215,217
- a{****************************************************************************}
- c219,221
- a{****************************************************************************}
- c223,224
- a { Must close file before we can }
- a { throw it out }
- c187,187
- c228,231
- a{****************************************************************************}
- c233,235
- a{****************************************************************************}
- c237,242
- a{****************************************************************************}
- c244,246
- a{****************************************************************************}
- c248,256
- a{****************************************************************************}
- c258,260
- a{****************************************************************************}
- c262,268
- e
- fCList.p
- x407163535,157999271
- a{****************************************************************************}
- c1,18
- a{****************************************************************************}
- c20,29
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c29,29
- a{****************************************************************************}
- c33,35
- a{****************************************************************************}
- c37,38
- a { Initialize superclass }
- c40,42
- a{****************************************************************************}
- c44,46
- a{****************************************************************************}
- c48,53
- a{****************************************************************************}
- c55,57
- a{****************************************************************************}
- c59,66
- a{****************************************************************************}
- c68,70
- a{****************************************************************************}
- aPROCEDURE CList.InsertAfter (theObject: CObject; { Object to insert in the list }
- a afterObject: CObject); { Object to insert it after }
- c74,76
- a { Find location of afterObject }
- c63,63
- c79,84
- a{****************************************************************************}
- c86,88
- a{****************************************************************************}
- c90,96
- a{****************************************************************************}
- c98,100
- a{****************************************************************************}
- c102,103
- a i: Longint; { Index into list }
- c93,93
- a { Find location of the object }
- c107,108
- a { If it's not already in front ... }
- c110,117
- a{****************************************************************************}
- c119,121
- a{****************************************************************************}
- aPROCEDURE CList.SendBack (theObject: CObject); { Object to move to the back }
- c103,103
- a i: Longint; { Index into list }
- c105,105
- a { Find location of the object }
- c107,108
- a { If it's not already in back ... }
- c131,137
- a{****************************************************************************}
- c139,141
- a{****************************************************************************}
- aPROCEDURE CList.MoveUp (theObject: CObject); { Object to move up in list }
- c124,124
- a i: Longint; { Index into list }
- c126,126
- a { Find location of object }
- c128,128
- a { If it's not at the front ... }
- c150,156
- a{****************************************************************************}
- c158,160
- a{****************************************************************************}
- aPROCEDURE CList.MoveDown (theObject: CObject); { Object to move down }
- c144,144
- c129,129
- a i: Longint; { Index into list }
- c146,146
- a { Find locaton of object }
- c148,148
- c136,136
- a { If it's not at the back ... }
- c131,132
- c173,179
- a{****************************************************************************}
- c181,184
- a{****************************************************************************}
- aPROCEDURE CList.MoveToIndex (theObject: CObject; { Object to move within the list }
- a index: Longint); { Index at which to move object }
- c144,144
- c155,155
- a i: Longint; { Index into the list }
- c146,146
- a { Find location of the object }
- c148,148
- c194,199
- a{****************************************************************************}
- c201,203
- a{****************************************************************************}
- c205,209
- a{****************************************************************************}
- c211,213
- a{****************************************************************************}
- c215,219
- a{****************************************************************************}
- c221,223
- a{****************************************************************************}
- c225,227
- a { If index is out of range }
- a { pass back NIL }
- c230,232
- a { Do direct indexing into list }
- c234,236
- a{****************************************************************************}
- c238,241
- a{****************************************************************************}
- c243,245
- a { Index is one greater than the }
- a { offset, which is zero-based }
- c189,189
- c249,251
- a{****************************************************************************}
- c253,256
- a{****************************************************************************}
- c258,263
- a{****************************************************************************}
- c265,268
- a{****************************************************************************}
- c270,276
- a{****************************************************************************}
- c278,281
- a{****************************************************************************}
- c283,313
- a{****************************************************************************}
- c315,318
- a{****************************************************************************}
- c320,353
- e
- fCMBarChore.p
- x501534292,375460494
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,25
- a{**************************************************}
- c27,30
- a{**************************************************}
- c32,40
- a gBartender.UpdateMenuBar; { Redraw to reflect changes }
- a gBartender.choreAssigned := FALSE; { Clear chore from gBartender }
- c40,40
- c44,46
- e
- fCMouseTask.p
- x423756360,213636088
- a{*****************************************************************************
- c1,8
- a *****************************************************************************}
- c10,18
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c20,20
- a{*****************************************************************************
- c22,24
- a *****************************************************************************}
- c26,32
- a{*** M O U S E T R A C K I N G M E T H O D S ***}
- c32,32
- a{*****************************************************************************
- c36,42
- a *****************************************************************************}
- c44,45
- a { Null Method }
- c47,48
- a{*****************************************************************************
- c50,55
- a *****************************************************************************}
- c57,59
- a { Null Method }
- c61,62
- a{*****************************************************************************
- c64,67
- a *****************************************************************************}
- c69,72
- a { Null Method }
- c61,62
- c76,76
- e
- fCObject.p
- x204522897,292771999
- a{****************************************************************************}
- c1,17
- a{****************************************************************************}
- c19,28
- a{****************************************************************************}
- c30,32
- a{****************************************************************************}
- c34,35
- a DisposeHandle(Handle(self));
- c37,38
- a{****************************************************************************}
- c40,42
- a{****************************************************************************}
- c44,51
- a { Objects are just handles }
- a copyOfObject := Handle(self);
- c54,60
- a{****************************************************************************}
- c62,65
- a{****************************************************************************}
- c67,68
- a kLockMask = $80; { bit 7 of handle state is set when locked }
- c70,73
- a { test lock bit of handle state }
- c75,75
- a locked := BAND(HGetState(Handle(self)), kLockMask) <> 0;
- c77,79
- a HLock(Handle(self))
- c81,81
- a HUnlock(Handle(self));
- c83,90
- a{****************************************************************************}
- c92,93
- a{****************************************************************************}
- c86,86
- c96,103
- e
- fCPane.p
- x236012649,16759377
- a{****************************************************************************}
- c1,30
- a{****************************************************************************}
- c32,50
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c49,49
- a{****************************************************************************}
- c54,56
- a{****************************************************************************}
- c58,66
- a { Initialize superclass }
- c68,70
- a { Set instance variables }
- c68,68
- c73,83
- a { Extra initialization }
- c83,83
- c86,91
- a{****************************************************************************}
- c93,95
- a{****************************************************************************}
- aPROCEDURE CPane.IViewTemp (anEnclosure: CView; { Enclosing view }
- a aSupervisor: CBureaucrat; { Boss in chain of command }
- a viewData: Ptr); { Template with View data }
- c100,104
- a { Initialize superclass }
- c94,94
- c107,108
- a { Set instance vars from template }
- c110,117
- a { Extra initialization }
- c119,121
- a{****************************************************************************}
- c123,125
- a{****************************************************************************}
- c127,131
- a { This is a subview of enclosure }
- a itsEnclosure.AddSubview(self);
- c134,135
- a { Set up Frame coordinates }
- c137,137
- a { Determine visible portion }
- c139,142
- a{****************************************************************************}
- c144,146
- a{****************************************************************************}
- c148,149
- a { Throw out drawing environment }
- c151,151
- a { Throw out pane border }
- c153,154
- a { makes sure that the last undo task is disposed. Since the }
- a { undo tasks usually have references back to this pane, }
- a { it would be bad if this pane was disposed and the task was }
- a { not informed. }
- c131,131
- c160,161
- a Notify(NIL); { the document disposes of the task }
- c163,165
- a { Pass message on to superclass }
- c167,169
- a{*** A C C E S S I N G M E T H O D S ***}
- c142,142
- a{****************************************************************************}
- c173,178
- a{****************************************************************************}
- c180,182
- a { Set top left coordinates }
- c184,185
- a { Set right and bottom using the }
- a { current width and height }
- c188,192
- a{****************************************************************************}
- c194,196
- a{****************************************************************************}
- c198,199
- a { Return copy of instance variable }
- c201,203
- a{****************************************************************************}
- c205,207
- a{****************************************************************************}
- c209,210
- a { Return instance variables }
- c212,215
- a{****************************************************************************}
- c217,221
- a{****************************************************************************}
- c223,224
- a { Return instance variables }
- c226,229
- a{****************************************************************************}
- c231,234
- a{****************************************************************************}
- c236,237
- a { Return copy of instance variable }
- c239,241
- a{****************************************************************************}
- c243,245
- a{****************************************************************************}
- c247,252
- a{****************************************************************************}
- c254,256
- a{****************************************************************************}
- c258,261
- a { Convert to Frame coordinates }
- c263,263
- a { Is point inside aperture? }
- c265,267
- a{****************************************************************************}
- c269,271
- a{****************************************************************************}
- c273,282
- a{****************************************************************************}
- c284,287
- a{****************************************************************************}
- c289,294
- a{****************************************************************************}
- c296,298
- a{****************************************************************************}
- c300,304
- a{****************************************************************************}
- c306,308
- a{****************************************************************************}
- c310,322
- a { clear old border }
- c324,326
- a { Can't assume that the pane's enclosure is a CPane }
- a { so RefreshRect is not safe here. }
- c329,334
- a { draw new border }
- c324,325
- c329,329
- c331,331
- c340,342
- a { the pane itself is not invalid }
- c344,347
- a{****************************************************************************}
- c349,351
- a{****************************************************************************}
- c353,362
- a{****************************************************************************}
- c364,364
- a{****************************************************************************}
- c366,370
- a{*** D I S P L A Y M E T H O D S ***}
- c304,304
- a{****************************************************************************}
- c374,376
- a{****************************************************************************}
- c378,387
- a{****************************************************************************}
- c389,391
- a{****************************************************************************}
- c393,402
- a{*** S I Z E A N D L O C A T I O N M E T H O D S ***}
- c326,326
- a{****************************************************************************}
- c406,408
- a{****************************************************************************}
- c410,418
- a { Determine location of pane in }
- a { Window coords }
- c347,347
- c422,428
- a{****************************************************************************}
- c430,432
- a{****************************************************************************}
- aPROCEDURE CPane.Offset (hOffset: Longint; { Pixels to offset vertically }
- c435,435
- a redraw: Boolean); { Redraw Pane or not? }
- c354,354
- c438,440
- a {)
- c442,444
- a{ }
- c446,453
- a BEGIN { Force redraw of area covered by }
- a { current location of pane }
- c383,385
- c370,370
- a { Change location of the pane }
- c461,464
- a { Keep hEncl, and vEncl up to date when pane is moved. }
- a { Thanks to Eric Olson for the fix. }
- c375,375
- c468,470
- a { Visible portion of pane could }
- a { change as a result of a shift }
- a { in its location }
- c474,477
- a { Redraw pane at its new location }
- c383,385
- c387,387
- c483,484
- a { Inform subviews of the move }
- a { so they can adjust their }
- a { locations }
- c488,491
- a{****************************************************************************}
- c493,497
- a{****************************************************************************}
- c402,402
- c500,500
- a redraw: Boolean); { Redraw Pane or not? }
- c413,413
- a oldAperture: LongRect; { Save old aperture }
- c504,506
- a {)
- c508,508
- a{ }
- c404,404
- c404,404
- c407,407
- c416,416
- c514,518
- a { Force redraw of area currently }
- a { occupied by the pane }
- a { and redraw border if there is one }
- c456,458
- a { Change dimensions of pane }
- c526,526
- a { Determine new aperture }
- c474,474
- c453,453
- c477,477
- a { Force draw of pane at new size }
- c421,421
- c456,456
- c534,535
- a { If autoRefresh is FALSE (and }
- a { other safety checks), we do }
- a { not want to redraw the area }
- a { which is common to the old and }
- a { new pane size. Note that the }
- a { Refresh method will have set }
- a { the port for us already. }
- c427,427
- c544,570
- a{****************************************************************************}
- c572,577
- a{****************************************************************************}
- aPROCEDURE CPane.AdjustToEnclosure (deltaEncl: Rect); { Change in enclosure's frame }
- c502,502
- a delta: Rect; { Change in this pane's frame }
- a hOffset: Integer; { Horizontal offset in location }
- a vOffset: Integer; { Vertical offset in location }
- a moved: Boolean; { Do we need to move the pane? }
- a sized: Boolean; { Do we need to size the pane? }
- c513,513
- c587,596
- a IF (sized) THEN { Pane must be moved and sized }
- c545,545
- c599,604
- a Offset(hOffset, vOffset, TRUE); { Move pane by offsetting location }
- c564,564
- c607,607
- a ELSE IF (sized) THEN { Change size of Pane }
- c484,484
- c610,613
- a { Pane stays the same, but change }
- a { in enclosure may change its }
- a { aperture }
- c617,620
- a{****************************************************************************}
- c622,624
- a{****************************************************************************}
- c626,654
- a{****************************************************************************}
- c656,658
- a{****************************************************************************}
- c660,688
- a{****************************************************************************}
- c690,693
- a{****************************************************************************}
- c695,708
- a{*** A D A P T I N G M E T H O D S ***}
- c569,569
- a{****************************************************************************}
- c712,718
- a{****************************************************************************}
- c720,747
- a{****************************************************************************}
- c749,755
- a{****************************************************************************}
- c757,784
- a{****************************************************************************}
- c786,791
- a{****************************************************************************}
- c793,816
- a{*** D R A W I N G M E T H O D S ***}
- c688,688
- a{****************************************************************************}
- c820,838
- a{****************************************************************************}
- c840,841
- a { Null Method }
- c707,708
- c702,702
- a{****************************************************************************}
- c847,857
- a{****************************************************************************}
- c708,708
- c860,868
- a { area is in Window coordinates, put it into Frame or QD coordinates }
- c730,730
- c871,871
- a OffsetRect(tmpArea, qd.thePort^.portRect.left, qd.thePort^.portRect.top)
- c873,883
- a { clip area to aperture of this view before drawing subviews}
- c885,890
- a { no need to SectRect here, already done in Pane_Draw }
- c892,895
- a{****************************************************************************}
- c897,899
- a{****************************************************************************}
- c901,904
- a { Refresh frame of Pane }
- c747,747
- c907,910
- a{****************************************************************************}
- c912,917
- a{****************************************************************************}
- c919,926
- a{****************************************************************************}
- c928,934
- a{****************************************************************************}
- aPROCEDURE CPane.RefreshRect (area: Rect); { Area in Frame coordinates }
- c795,795
- c938,943
- a{****************************************************************************}
- c945,947
- a{****************************************************************************}
- c949,961
- a{*** P R I N T I N G M E T H O D S ***}
- c802,802
- a{****************************************************************************}
- c965,968
- a{****************************************************************************}
- c970,973
- a { Tell the printer we have only one page, and let it use the }
- a { printable page area for the strip sizes }
- c816,816
- c977,981
- a{ so they will be passed a local copy of the range }
- a{****************************************************************************}
- c984,986
- a{****************************************************************************}
- c988,1001
- a { subviews should not be able to modify the page range }
- c1003,1008
- a{ Number of the page to print }
- a{ Width of printed page in pixels }
- a{ Height of page in pixels }
- a{ setup class variable cPageArea with portion of page to be printed }
- a{ but is the same size as the page. }
- a{****************************************************************************}
- c1015,1019
- a{****************************************************************************}
- c1021,1030
- a { pass a rectangle to DrawAll that is based on the frame top left }
- c1032,1041
- a{****************************************************************************}
- c1043,1045
- a{****************************************************************************}
- c1047,1062
- a{****************************************************************************}
- c1064,1068
- a{****************************************************************************}
- c1070,1085
- a clipR := cPageArea; { cPageArea is area in Window coordinates }
- c1087,1087
- a OffsetRect(clipR, qd.thePort^.portRect.left, qd.thePort^.portRect.top)
- c1089,1098
- a{*** C A L I B R A T I N G M E T H O D S ***}
- c910,910
- a{****************************************************************************}
- c1102,1132
- a{****************************************************************************}
- c1134,1137
- a IF (cPreparedView = self) THEN
- c1139,1146
- a { Use the Port of this Pane }
- a { Set to Frame coordinates }
- c961,961
- c1150,1151
- a { Setup the origin for the Pane and clip drawing }
- a { to the visible portion. }
- c961,961
- c1155,1170
- a{****************************************************************************}
- c1172,1174
- a{****************************************************************************}
- c1176,1182
- a{****************************************************************************}
- c1184,1192
- a{****************************************************************************}
- c1194,1198
- a frame.left := 0; { Frame defines pane coords }
- a frame.top := 0; { Top left of frame is at (0, 0) }
- c1201,1203
- a { Determine location of pane in }
- a { Window coords }
- c1008,1008
- c1207,1208
- a { Origin maps between Frame and }
- a { Window coords. Origin is the }
- a { top left corner of the window }
- a { expressed in Frame coords }
- c1008,1008
- c1214,1219
- a{****************************************************************************}
- c1221,1230
- a{****************************************************************************}
- c1232,1234
- a { Adjust dimensions of the pane }
- c1236,1237
- a { Origin moves with the top left }
- a { corner of the pane }
- a { Put top left of frame at (0, 0) }
- c1241,1250
- a{****************************************************************************}
- c1252,1255
- a{****************************************************************************}
- c1257,1262
- a {)
- c1264,1264
- a{ }
- c1266,1271
- a { TCL 1.1 Save the previous aperture before recalculating.}
- a { Since a pane's aperture is the intersection of its frame}
- a { and its enclosure's aperture, we know that if this}
- a { pane's aperture didn't change, then none if its}
- a { subpane's apertures will change either. }
- a { So we recalc the aperture, and if it doesn't change,}
- a { there's no need to pass the message to the subpanes}
- a { Thanks to Doug Wyatt for the tip.}
- c1054,1054
- a { Get enclosure's aperture }
- c1054,1054
- c1283,1283
- a { Aperture is the frame restricted }
- a { by the enclosure's aperture }
- c1286,1286
- a { Convert it to Frame coords }
- c1288,1291
- a { Pass it on to subviews }
- c1293,1296
- a{*** C O O R D I N A T E T R A N S F O R M M E T H O D S ***}
- c1098,1098
- a{****************************************************************************}
- c1300,1302
- a{****************************************************************************}
- c1304,1310
- a{****************************************************************************}
- c1312,1314
- a{****************************************************************************}
- c1316,1322
- a{****************************************************************************}
- c1324,1326
- a{****************************************************************************}
- c1328,1335
- a{****************************************************************************}
- c1337,1339
- a{****************************************************************************}
- c1341,1347
- a{****************************************************************************}
- c1349,1352
- a{****************************************************************************}
- c1354,1363
- a{****************************************************************************}
- c1365,1368
- a{****************************************************************************}
- c1370,1378
- a{****************************************************************************}
- c1380,1383
- a{****************************************************************************}
- c1385,1394
- a{****************************************************************************}
- c1396,1399
- a{****************************************************************************}
- c1401,1409
- a{****************************************************************************}
- c1411,1413
- a{****************************************************************************}
- c1169,1169
- c1416,1425
- a{****************************************************************************}
- c1427,1430
- a{****************************************************************************}
- c1432,1445
- a { ??? We could call WaitNextEvent }
- a { here to give background apps }
- a { some CPU time. However, this }
- a { makes mouse tracking a little }
- a { bit sluggish. }
- c1203,1203
- a WHILE StillDown DO { Track while button is pressed }
- c1453,1471
- a{****************************************************************************}
- c1473,1480
- a{****************************************************************************}
- c1482,1489
- a framePt.h := framePt.h - qd.thePort^.portRect.left;
- a framePt.v := framePt.v - qd.thePort^.portRect.top;
- c1492,1496
- a{****************************************************************************}
- c1498,1500
- a{****************************************************************************}
- c1502,1509
- a OffsetLongRect(frameRect, -qd.thePort^.portRect.left, -qd.thePort^.portRect.top);
- c1492,1493
- c1513,1515
- a{****************************************************************************}
- c1517,1519
- a{****************************************************************************}
- c1521,1528
- a qdPt.h := qdPt.h + qd.thePort^.portRect.left;
- a qdPt.v := qdPt.v + qd.thePort^.portRect.top;
- c1492,1493
- c1533,1535
- a{****************************************************************************}
- c1537,1539
- a{****************************************************************************}
- c1541,1548
- a OffsetRect(qdRect, qd.thePort^.portRect.left, qd.thePort^.portRect.top);
- c1492,1493
- c1552,1554
- a{****************************************************************************}
- c1556,1559
- a{****************************************************************************}
- c1561,1576
- a{****************************************************************************}
- c1578,1584
- a{****************************************************************************}
- c1586,1593
- a{**************************************************}
- c1595,1598
- a{**************************************************}
- c1322,1322
- c1601,1608
- a{**************************************************}
- c1610,1613
- a{**************************************************}
- c1335,1335
- c1616,1622
- a{**************************************************}
- c1624,1627
- a{**************************************************}
- c1347,1347
- c1630,1632
- a paneArea: Rect; { Area in Pane's Frame coords }
- c1634,1638
- a { Only draw if pane is visible }
- c1363,1363
- c1641,1645
- a { Get the pane's frame in window coordinates }
- a { then ask the border for the border rect. }
- a { If that rect intersects the area to draw, then }
- a { go ahead and draw the border }
- c1363,1363
- c1651,1666
- a { DrawAll always receives the area in Window }
- a { coordinates. If we're not printing, clip the }
- a { area to the aperture. }
- c1670,1670
- a { See if area intersects the }
- a { aperture of the Pane }
- a { be drawn. }
- c1674,1675
- a { Some portion of this Pane must }
- a { be drawn }
- c1678,1681
- a ELSE { printing, don't clip the area }
- c1645,1645
- c1684,1692
- e
- fCPaneBorder.p
- x290790889,135427883
- a{****************************************************************************}
- c1,17
- a{****************************************************************************}
- c19,28
- a{****************************************************************************}
- c30,34
- a{****************************************************************************}
- c36,49
- a SetPattern(qd.black);
- c51,53
- a{****************************************************************************}
- c55,58
- a{****************************************************************************}
- c60,107
- a SetPattern(qd.black);
- c101,101
- c110,125
- a{****************************************************************************}
- c127,129
- a{****************************************************************************}
- c131,135
- a{****************************************************************************}
- c137,139
- a{****************************************************************************}
- c141,145
- a{****************************************************************************}
- c147,164
- a{****************************************************************************}
- c166,169
- a { Shadowing only applies to the kBorderFrame setting }
- c171,174
- a{****************************************************************************}
- c176,178
- a{****************************************************************************}
- c180,184
- a{****************************************************************************}
- c186,188
- a{****************************************************************************}
- c190,196
- a{****************************************************************************}
- c198,200
- a{****************************************************************************}
- c202,207
- a{****************************************************************************}
- c209,214
- a{****************************************************************************}
- c216,226
- a{****************************************************************************}
- c228,230
- a{****************************************************************************}
- c232,239
- a{****************************************************************************}
- c241,244
- a{****************************************************************************}
- c246,251
- a{****************************************************************************}
- c253,255
- a{****************************************************************************}
- c257,262
- a{****************************************************************************}
- c264,271
- a{****************************************************************************}
- c273,277
- a{****************************************************************************}
- c279,281
- a{****************************************************************************}
- c283,288
- a{****************************************************************************}
- c290,294
- a{****************************************************************************}
- c296,331
- a{****************************************************************************}
- c333,335
- a{****************************************************************************}
- c337,393
- e
- fCPanorama.p
- x488006883,202516241
- a{****************************************************************************}
- c1,28
- a{****************************************************************************}
- c30,40
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c40,40
- a{****************************************************************************}
- c44,46
- a{****************************************************************************}
- c48,67
- a{****************************************************************************}
- c69,71
- a{****************************************************************************}
- c67,67
- aPROCEDURE CPanorama.IViewTemp (anEnclosure: CView; { Enclosing view }
- a aSupervisor: CBureaucrat; { Boss in chain of command }
- a viewData: Ptr); { Template with View data }
- c77,83
- a { Set instance vars from template }
- c81,81
- c86,91
- a {*** A C C E S S I N G M E T H O D S ***}
- c93,94
- a{****************************************************************************}
- c96,108
- a{****************************************************************************}
- c110,116
- a{****************************************************************************}
- c118,127
- a{****************************************************************************}
- c129,134
- a{****************************************************************************}
- c136,144
- a{****************************************************************************}
- c146,148
- a { Integer division truncates }
- a { We get the number of complete }
- a { units spanned by the frame }
- c152,155
- a{****************************************************************************}
- c157,162
- a{****************************************************************************}
- c164,165
- a { Set instance variable }
- c167,172
- a{****************************************************************************}
- c174,176
- a{****************************************************************************}
- c178,179
- a { Pass back copy of instance var }
- c181,183
- a{ Set instance variable }
- a{****************************************************************************}
- c186,190
- a{****************************************************************************}
- c192,194
- a { Pass back copy of instance var }
- c196,200
- a{****************************************************************************}
- c202,204
- a{****************************************************************************}
- c206,211
- a{****************************************************************************}
- c213,216
- a{****************************************************************************}
- c218,225
- a{****************************************************************************}
- c227,229
- a{****************************************************************************}
- c231,232
- a { Return copies of instance vars }
- c234,237
- a{****************************************************************************}
- c239,241
- a{****************************************************************************}
- c243,244
- a { Set instance variable }
- c246,248
- a{****************************************************************************}
- c250,254
- a{****************************************************************************}
- c256,260
- a{****************************************************************************}
- c262,267
- a{****************************************************************************}
- c269,274
- a{*** C A L I B R A T I N G M E T H O D S ***}
- c237,237
- a{****************************************************************************}
- c278,283
- a{****************************************************************************}
- c237,237
- c286,288
- a { Adjust dimensions of the pane }
- c290,293
- a { Shift edges by delta }
- c295,298
- a { Scroll position is tied to the }
- a { left of the frame. }
- c301,305
- a{*** S C R O L L I N G M E T H O D S ***}
- c260,260
- c260,260
- a{****************************************************************************}
- c310,315
- a{****************************************************************************}
- c317,359
- a{****************************************************************************}
- c361,364
- a{****************************************************************************}
- c366,377
- a{****************************************************************************}
- c379,382
- a{****************************************************************************}
- c384,385
- a { Null Method }
- c358,359
- a{ Mouse location in Frame coords }
- a{****************************************************************************}
- c391,394
- a{****************************************************************************}
- c396,453
- a{****************************************************************************}
- c455,458
- a{****************************************************************************}
- c460,461
- a VAR macEvent: EventRecord);
- c397,397
- c464,485
- a itsScrollPane.DoVertScroll(kControlPageUpPart);
- c487,491
- a itsScrollPane.DoVertScroll(kControlPageDownPart);
- c487,488
- c495,499
- a{*** P R I N T I N G M E T H O D S ***}
- c453,453
- a{****************************************************************************}
- c503,507
- a{****************************************************************************}
- c509,518
- a { Get the full extent of the panorama }
- c520,520
- a { determine how many horizontal and }
- a { vertical strips are required }
- c523,524
- a { tell the printer how many strips, strips }
- a { are initially set to page width and }
- a { height }
- c528,532
- a{****************************************************************************}
- c534,536
- a{****************************************************************************}
- c499,499
- c539,541
- a { Save current position since it }
- a { may have to be changed during }
- a { the print loop }
- c545,550
- a{****************************************************************************}
- c552,554
- a{****************************************************************************}
- c499,499
- aPROCEDURE CPanorama.PrintPage (pageNum: Integer; { Number of the page to print }
- c499,499
- a pageWidth: Integer; { Width of printed page in pixels }
- a pageHeight: Integer; { Height of page in pixels }
- c561,571
- a { scroll to the start of the page }
- c499,499
- c574,580
- a { setup class variable cPageArea with portion of page to be printed }
- c499,499
- c583,593
- a{****************************************************************************}
- c595,597
- a{****************************************************************************}
- c512,512
- c600,612
- e
- fCPicture.p
- x227827022,168103664
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,26
- a{****************************************************************************}
- c28,30
- a{****************************************************************************}
- c32,49
- a{****************************************************************************}
- c51,53
- a{****************************************************************************}
- aPROCEDURE CPicture.IViewTemp (anEnclosure: CView; { Enclosing view }
- a aSupervisor: CBureaucrat; { Boss in chain of command }
- a viewData: Ptr); { Template with View data }
- c58,73
- a{ Set instance vars from template }
- c75,76
- a{****************************************************************************}
- c78,80
- a{****************************************************************************}
- c82,94
- a{****************************************************************************}
- c96,98
- a{****************************************************************************}
- c94,94
- c101,137
- a{****************************************************************************}
- c139,143
- a{****************************************************************************}
- c145,159
- a { determine if this picture is from a resource }
- c159,159
- c162,180
- a{****************************************************************************}
- c182,184
- a{****************************************************************************}
- c186,187
- a { Return instance variable }
- c189,191
- a{****************************************************************************}
- c193,195
- a{****************************************************************************}
- c197,208
- a{****************************************************************************}
- c210,213
- a{****************************************************************************}
- c215,221
- a { Boundaries are the same as frame }
- a { left of the frame }
- c224,227
- a ELSE { Display picture at normal size }
- c221,221
- a { Top left of picture is at top }
- a { Put top left of bounds at (0, 0) }
- a { top left may have moved }
- a { only when it is scaled }
- c208,208
- c235,237
- a { Need to reposition picture since }
- a { Size of frame affects picture }
- c240,244
- a{****************************************************************************}
- c246,248
- a{****************************************************************************}
- c250,251
- a { Return instance variable }
- c253,255
- a{****************************************************************************}
- c257,265
- a{****************************************************************************}
- c234,234
- c268,275
- a{****************************************************************************}
- c277,279
- a{****************************************************************************}
- c281,288
- e
- fCPrinter.p
- x498393156,338268935
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,22
- a TCL, Printing;
- c21,21
- c25,26
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c24,24
- a{****************************************************************************}
- c33,42
- a{****************************************************************************}
- c44,64
- a PrintDefault(THPrint(aMacTPrint)); { Set default print record values }
- c66,68
- a { Check validity of existing }
- c70,71
- a {)
- c73,75
- a{ }
- c77,97
- a{****************************************************************************}
- c99,102
- a{****************************************************************************}
- c104,105
- a ForgetHandle(macTPrint); { Throw out Toolbox print record }
- c107,109
- a { Pass message on to superclass }
- c96,97
- a{****************************************************************************}
- c114,120
- a{****************************************************************************}
- c122,125
- a Assert(NOT printMgrOpen);
- c127,141
- a{****************************************************************************}
- c143,146
- a{****************************************************************************}
- c148,172
- a{****************************************************************************}
- c174,181
- a{****************************************************************************}
- c183,186
- a { Open the printer driver }
- c188,190
- a { Check validity of print record }
- c192,194
- a { Close the printer driver }
- c196,196
- a GetPrintRecord := macTPrint; { Return instance variable }
- c172,172
- c171,172
- c198,198
- a{****************************************************************************}
- c203,218
- a{****************************************************************************}
- aPROCEDURE CPrinter.GetPageInfo (VAR paperRect, { The physical paper size }
- a pageRect: Rect; { Printable area of the page }
- a VAR hRes, { Horizontal resolution }
- a vRes: Integer); { Vertical resolution }
- c224,224
- a recPtr: TPPrint; { Deference of print record handle }
- c226,227
- a { Open the printer driver }
- c198,198
- c230,232
- a { Check validity of print record }
- c198,198
- c235,237
- a ClosePrintMgr; { Close the printer driver }
- a IF (macTPrint <> NIL) THEN { Extract info from print record }
- c232,232
- c241,247
- a ELSE { There is no print record }
- c232,232
- c250,258
- a{****************************************************************************}
- c260,268
- a{****************************************************************************}
- c270,271
- a changed: Boolean; { Has print record changed? }
- c234,234
- c274,276
- a IF (OpenPrintMgr(TRUE)) THEN { Open printer driver }
- a BEGIN { Toolbox trap posts the dialog }
- c279,281
- a { Close the printer driver }
- c283,288
- a{****************************************************************************}
- c290,294
- a{****************************************************************************}
- c296,301
- a { Open printer driver }
- c303,307
- a { Close the printer driver }
- c273,273
- c283,283
- c311,317
- a{****************************************************************************}
- c319,324
- a{****************************************************************************}
- c326,390
- a { Print error before PrClose }
- c340,340
- c393,394
- a { Don't report error if the user }
- a { aborted the printing }
- c342,342
- c398,404
- a { Close the printer driver }
- c353,353
- c352,353
- a { Reset error code to what it was }
- a { before closing printer in case }
- a { Document needs it }
- c353,353
- c413,418
- a{****************************************************************************}
- c420,424
- a{****************************************************************************}
- c426,430
- a{****************************************************************************}
- c432,435
- a{****************************************************************************}
- c437,442
- a{****************************************************************************}
- c444,446
- a{****************************************************************************}
- c448,457
- a{****************************************************************************}
- c459,461
- a{****************************************************************************}
- c463,469
- a Assert(printRec <> NIL);
- c471,478
- a{****************************************************************************}
- c480,482
- a{****************************************************************************}
- c484,488
- a Assert((vStripNum >= 1) & (vStripNum <= itsStripWidths.GetNumItems + 1));
- c490,493
- a{****************************************************************************}
- c495,497
- a{****************************************************************************}
- c499,503
- a Assert((hStripNum >= 1) & (hStripNum <= itsStripHeights.GetNumItems + 1));
- c505,508
- a{****************************************************************************}
- c510,512
- a{****************************************************************************}
- c514,523
- a{ must have some pixels on a page }
- a{****************************************************************************}
- c526,528
- a{****************************************************************************}
- c530,532
- a Assert(aStripWidth > 0);
- c534,539
- a{****************************************************************************}
- c541,543
- a{****************************************************************************}
- c545,553
- a{****************************************************************************}
- c555,557
- a{****************************************************************************}
- c559,561
- a { must have some pixels on a page }
- a Assert(aStripHeight > 0);
- c564,569
- a{****************************************************************************}
- c571,573
- a{****************************************************************************}
- c575,588
- a{****************************************************************************}
- c590,592
- a{****************************************************************************}
- c594,599
- a Assert(HavePagination);
- c601,602
- a Assert(pageNum <= hStrips * vStrips);
- c604,615
- a{****************************************************************************}
- c617,619
- a{****************************************************************************}
- c621,631
- a{****************************************************************************}
- c633,634
- a{****************************************************************************}
- c636,648
- e
- fCRunArray.p
- x116273929,236702407
- a{****************************************************************************}
- c1,25
- a{****************************************************************************}
- c27,36
- a{****************************************************************************}
- c38,40
- a{****************************************************************************}
- c42,48
- a{****************************************************************************}
- c50,53
- a{****************************************************************************}
- c55,59
- a{****************************************************************************}
- c61,69
- a{****************************************************************************}
- c71,76
- a Assert(item > 0);
- a Assert(count > 0);
- c79,79
- a { first insert the value once }
- c79,79
- c82,85
- a { Index is out of range. first we clip it to numItems + 1 }
- a { then, if this is not the first run added, we check if }
- a { has the same value as the last run if not we have to add }
- a { a new run }
- c79,79
- c91,93
- a { insert to last run, just bump runLength }
- c79,79
- c96,103
- a { Rather than duplicate SetValue here, we just insert it to }
- a { the existing run for the given index, i.e. just bump }
- a { the runLength and then call SetValue, which will handle }
- a { the case where a new run might have to be created }
- c90,90
- a { clip item index to size + 1 }
- c90,90
- c111,115
- a { now insert the rest, if any, once we know the runs won't change }
- c117,120
- a Assert(runIndex <> BAD_INDEX); { it must exist }
- c99,99
- c123,130
- a{****************************************************************************}
- c132,136
- a{****************************************************************************}
- c138,150
- a Assert((index > 0) & (index <= itemCount));
- c130,130
- c153,155
- a { NOTE: runIndex is zero-based, firstInRun, lastInRun, and index }
- a { are all one-based. }
- c130,130
- c159,164
- a { see if the item can go in previous or next run }
- c149,149
- c167,168
- a { bump the count }
- c170,173
- a { we no longer need this run }
- c175,176
- a { TCL 1.1.1 DLP 12/9/91 : decrement count for this run }
- c178,184
- a { we no longer need this run }
- c175,176
- a { TCL 1.1.1 DLP 12/9/91 : decrement count for this run }
- c178,178
- c158,158
- c179,179
- c192,193
- a { we already know that we couldn't merge the new value }
- a { into the previous or next run, so we just change }
- a { the value for this run }
- c197,199
- a { We have to break the run into two or more runs. }
- a { At this point we know the run size is greater than }
- a { one and, if the item is at the start or end of the }
- a { run, we can't merge it with the previous or next run.}
- a { Therefore the item itself starts a new run, and there}
- a { may be a new run preceeding or following the item }
- c164,164
- c168,168
- c166,166
- a { check preceeding run }
- c210,212
- a runIndex := runIndex + 1; { everything just moved down }
- c171,171
- c215,220
- a { The item now has the run all to itself. Update the value }
- a { and length. }
- c197,197
- c224,228
- a{****************************************************************************}
- c230,233
- a{****************************************************************************}
- c235,239
- a Assert((index > 0) & (index <= itemCount));
- c206,206
- c242,245
- a{****************************************************************************}
- c247,249
- a{****************************************************************************}
- c251,256
- a Assert((index > 0) & (index <= itemCount));
- c206,206
- c242,242
- c260,270
- a{****************************************************************************}
- c272,274
- a{****************************************************************************}
- c276,286
- a{****************************************************************************}
- c288,291
- a{****************************************************************************}
- c293,303
- a { clip start and end }
- c258,258
- c306,316
- a { start and end are in the same run }
- c270,270
- c319,322
- a { add in the this run from startIndex down }
- a { and then scan thru runs until endIndex }
- c270,270
- c326,330
- a { loop over all items, but we'll exit when endIndex is reached }
- c332,336
- a { we've found endIndex }
- c338,344
- a Assert(lastThisRun < itemCount);
- c346,350
- a{****************************************************************************}
- c352,356
- a{*****************************************************************************}
- c358,380
- a { falling out of the loop means aSum was too large or zero runs }
- c382,385
- a{****************************************************************************}
- c387,394
- a{****************************************************************************}
- c396,406
- a { switch to zero-based offsets }
- c350,350
- c409,429
- a{****************************************************************************}
- c431,433
- a{****************************************************************************}
- c435,445
- a{****************************************************************************}
- c447,450
- a{****************************************************************************}
- c452,462
- a { if the deleted run was between two runs with the same value }
- a { then we can merge them. }
- c404,404
- c466,473
- a{****************************************************************************}
- c475,478
- a{****************************************************************************}
- c480,490
- e
- fCScrollBar.p
- x235246372,145506308
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,24
- a{**************************************************}
- c26,29
- a{**************************************************}
- c31,88
- a itsEnclosure.AddSubview(self); { This is a subview of enclosure }
- a SetControlReference(macControl, longint(self));
- c87,87
- c92,107
- a{**************************************************}
- c109,112
- a{**************************************************}
- c106,106
- c115,149
- a{**************************************************}
- c151,154
- a{**************************************************}
- c148,148
- c157,173
- a{**************************************************}
- c175,179
- a{**************************************************}
- c172,172
- c182,196
- a{**************************************************}
- c198,202
- a{**************************************************}
- c195,195
- c205,214
- a{**************************************************}
- c216,220
- a{**************************************************}
- c213,213
- c223,225
- a CallTheThumbFunc(self, delta, theThumbFunc); { exists; otherwise do nothing }
- c212,214
- a{**************************************************}
- c231,235
- a{**************************************************}
- c222,222
- aPROCEDURE CScrollBar.SetThumbFunc (aThumbFunc: ControlActionUPP);
- c224,224
- c240,243
- e
- fCScrollPane.p
- x495323502,117696713
- a{****************************************************************************}
- c1,19
- a{****************************************************************************}
- c21,32
- aPROCEDURE SBarThumbFunc (theSBar: ControlHandle;
- c34,38
- aVAR
- a SBarActionProcUPP : ControlActionUPP;
- a SBarThumbFuncUPP : ControlActionUPP;
- c36,36
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- a{****************************************************************************}
- c41,43
- a{****************************************************************************}
- c45,71
- a{****************************************************************************}
- c73,75
- a{****************************************************************************}
- aPROCEDURE CScrollPane.IViewTemp (anEnclosure: CView; { Enclosing view }
- a aSupervisor: CBureaucrat; { Boss in chain of command }
- a viewData: Ptr); { Template with View data }
- c70,70
- c81,84
- a { Initialize Superclass }
- c86,86
- a { Set instance vars from template }
- c80,80
- c89,92
- a { Extra initialization }
- c94,96
- a{****************************************************************************}
- c98,100
- a{****************************************************************************}
- c102,115
- a { Since global data is zeroed by the loader. }
- a IF SBarActionProcUPP = NIL THEN
- a SBarActionProcUPP := NewControlActionProc(@SBarActionProc);
- a IF SBarThumbFuncUPP = NIL THEN
- a SBarThumbFuncUPP := NewControlActionProc(@SBarThumbFunc);
- c115,119
- a itsHorizSBar.IScrollBar(self, self, HORIZONTAL, width - shrinkage, frame.left, frame.bottom - SBARSIZE);
- a itsHorizSBar.SetActionProc(SBarActionProcUPP);
- a itsHorizSBar.SetThumbFunc(SBarThumbFuncUPP);
- c123,129
- a itsVertSBar.IScrollBar(self, self, VERTICAL, height - shrinkage, frame.right - SBARSIZE, frame.top);
- a itsVertSBar.SetActionProc(SBarActionProcUPP);
- a itsVertSBar.SetThumbFunc(SBarThumbFuncUPP);
- c123,124
- c135,139
- a itsSizeBox.ISizeBox(self, self);
- c123,124
- c143,150
- a{*** A C C E S S I N G M E T H O D S ***}
- c143,143
- c143,143
- a{****************************************************************************}
- c155,157
- a{****************************************************************************}
- c159,161
- a itsPanorama.SetScrollPane(self);
- c163,166
- a{****************************************************************************}
- c168,172
- a{****************************************************************************}
- c174,175
- a { Set instance variables }
- c177,180
- a{****************************************************************************}
- c182,185
- a{****************************************************************************}
- c187,188
- a { Get instance variables }
- c190,193
- a{****************************************************************************}
- c195,200
- a{****************************************************************************}
- c202,203
- a { Set instance variables }
- c205,208
- a{****************************************************************************}
- c210,213
- a{****************************************************************************}
- c180,180
- c216,217
- a { Start off with the frame }
- c219,219
- a { add a 1-pixel border }
- c221,223
- a { Subtract horizontal scroll bar }
- c225,227
- a { Subtract vertical scroll bar }
- c229,232
- a{*** S C R O L L B A R M A I N T E N A N C E M E T H O D S ***}
- c193,193
- a{****************************************************************************}
- c236,239
- a{****************************************************************************}
- c241,248
- a { Take a quick exit if no }
- a { Panorama is installed }
- c251,259
- a { Controls are limited to shorts }
- a { Need to scale in case extent is }
- a { larger than a short }
- c215,215
- c264,268
- a { New maximum scroll bar setting }
- c223,223
- c271,279
- a{****************************************************************************}
- c281,284
- a{****************************************************************************}
- c286,290
- a { Take a quick exit if no }
- a { Panorama is installed }
- c251,251
- c294,303
- a{****************************************************************************}
- c305,307
- a{****************************************************************************}
- c263,263
- c310,318
- a{*** S C R O L L P E R F O R M A N C E M E T H O D S ***}
- c279,279
- c279,279
- c279,279
- c279,279
- a{****************************************************************************}
- c325,327
- a{****************************************************************************}
- aPROCEDURE CScrollPane.DoHorizScroll (whichPart: Integer); { Part of scroll bar clicked in }
- c287,287
- a delta: Longint; { Number of pixels to scroll }
- a minmax: Longint; { Minimum or Maximum delta }
- a ticks: Longint; { Tick count at end of Delay }
- c334,336
- a kControlUpButtonPart:
- c338,338
- a kControlDownButtonPart:
- c340,340
- a kControlPageUpPart:
- c342,345
- a kControlPageDownPart:
- c342,343
- c349,372
- a{****************************************************************************}
- c374,376
- a{****************************************************************************}
- aPROCEDURE CScrollPane.DoVertScroll (whichPart: Integer); { Part of scroll bar clicked in }
- c330,330
- a delta: Longint; { Number of pixels to scroll }
- a minmax: Longint; { Minimum or Maximum delta }
- a ticks: Longint; { Tick count at end of Delay }
- c334,336
- a kControlUpButtonPart:
- c387,387
- a kControlDownButtonPart:
- c389,389
- a kControlPageUpPart:
- c342,343
- c393,394
- a kControlPageDownPart:
- c342,343
- c398,420
- a{****************************************************************************}
- c422,424
- a{****************************************************************************}
- c426,437
- a { Because of the scaling of control values when using long coordinates }
- a { dragging the thumb to the beginning or end of the scroll bar will }
- a { sometimes not fully scroll to the beginning or end. Catch this by }
- a { checking if the current value is the max or min. }
- c371,371
- c401,401
- c444,475
- a{****************************************************************************}
- c477,480
- a{****************************************************************************}
- c482,488
- a{**************************************************}
- c490,494
- a{**************************************************}
- c420,420
- c497,504
- a theSBar := CScrollBar(GetControlReference(macControl));
- c506,513
- a{**************************************************}
- c515,518
- a{**************************************************}
- c437,437
- aPROCEDURE SBarThumbFunc (theSBar: ControlHandle;
- c522,523
- a IF CScrollBar(theSBar).theOrientation = HORIZONTAL THEN
- a CScrollPane(CScrollBar(theSBar).itsSupervisor).DoThumbDrag(delta, 0)
- c526,526
- a CScrollPane(CScrollBar(theSBar).itsSupervisor).DoThumbDrag(0, delta);
- c474,475
- c437,437
- c531,531
- e
- fCSizeBox.p
- x265469509,205503053
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,22
- a{****************************************************************************}
- c24,27
- a{****************************************************************************}
- c29,39
- a{****************************************************************************}
- c41,43
- a{****************************************************************************}
- c39,39
- c46,54
- a { Use SICN Resource for active box }
- c56,67
- a { Inactive size box is blank }
- c69,76
- a{****************************************************************************}
- c78,80
- a{****************************************************************************}
- c76,76
- c83,86
- a { If size box is not active ... }
- c88,89
- a { Set flag }
- c91,91
- a { Make sure it's on screen }
- c93,95
- a { Force redraw so that an active }
- a { size box is displayed }
- c98,98
- a { Ensure that it's not drawn again }
- c100,106
- a{****************************************************************************}
- c108,110
- a{****************************************************************************}
- c100,100
- c113,116
- a { If size box is active }
- c118,119
- a { Clear flag }
- c121,121
- a { Make sure it's on screen }
- c123,125
- a { Force redraw so that an inactive }
- a { size box is displayed }
- c128,134
- e
- fCSwitchboard.p
- x254643013,519842849
- a{****************************************************************************}
- c1,21
- a{****************************************************************************}
- c23,28
- a TCL, DiskInit;
- c27,27
- aFUNCTION AppleEventHandler (VAR event: AppleEvent;
- a VAR reply: AppleEvent;
- c33,33
- aFUNCTION AppleEventIdleProc(VAR macEvent: EventRecord;
- c35,39
- a{* Class Constants *}
- c37,37
- c42,48
- a{****************************************************************************}
- c50,52
- a{****************************************************************************}
- c54,54
- c47,47
- aVAR
- a appleEventsHandlerUPP: AEEventHandlerUPP;
- c47,47
- c55,58
- a { Install a single handler for all application AppleEvents}
- c60,60
- a appleEventsHandlerUPP := NewAEEventHandlerProc(@AppleEventHandler);
- a FailOSErr(AEInstallEventHandler(typeWildCard, typeWildCard, appleEventsHandlerUPP, 0, FALSE));
- c62,64
- a{****************************************************************************}
- c66,70
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoMouseDown (VAR macEvent: EventRecord); { The mouse down event }
- c64,64
- c74,74
- a { Let Desktop handle it }
- c64,64
- c77,79
- a { Save for multi-click checking }
- c81,85
- a{****************************************************************************}
- c87,93
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoMouseUp (VAR macEvent: EventRecord);{ The mouse up event }
- c96,97
- a { Let target view handle it }
- c82,82
- c100,101
- a { Save for multi-click checking }
- c84,84
- c104,107
- a{****************************************************************************}
- c109,111
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoKeyEvent (VAR macEvent: EventRecord); { The keyboard event }
- c114,114
- a theChar: Char; { The associated character }
- a keyCode: Byte; { Code for the associated key }
- a menuChoice: Longint; { Menu equivalent key command }
- a menuID: Integer; { Check state of the command key }
- c119,131
- a { Command key was down. Extract }
- a { the character and check for a }
- a { keyboard equivalent for a menu }
- a { selection. }
- c106,106
- c137,139
- a { Handle menu command or pass it }
- a { to the gopher if not a menu choice }
- c122,122
- c143,145
- a { Unhighlight the menu title }
- c147,148
- a ELSE { pass non-menu commands key up the command chain }
- c150,153
- a KeyF1: { perform Undo command }
- c144,144
- c156,162
- a KeyF2: { perform Cut command }
- c144,144
- c156,156
- c166,171
- a KeyF3: { perform Copy command }
- c144,144
- c156,156
- c175,180
- a KeyF4: { perform Paste command }
- c144,144
- c156,156
- c184,189
- a OTHERWISE { A regular keystroke; let the }
- a { gopher handle it. }
- c192,196
- a keyUp: { Key was released }
- c198,199
- a autoKey: { Key was held down }
- c201,205
- a{****************************************************************************}
- c207,209
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoDiskEvent (VAR macEvent: EventRecord); { The disk event }
- c212,212
- a corner: Point; { Location for Dialog box }
- c214,217
- a { Some sort of error occurred. }
- a { Check if user wants to format }
- a { the disk. }
- c192,192
- c222,223
- a { ??? Can dialog box be centered }
- a { There doesn't appear to be a }
- a { DLOG resource for this one. }
- a { Location (112,80) is the value }
- a { used by Finder 6.1. }
- c192,192
- c230,233
- a{****************************************************************************}
- c235,237
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoUpdate (VAR macEvent: EventRecord); { The update event }
- c212,212
- c241,252
- a{****************************************************************************}
- c254,256
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoActivate (VAR macEvent: EventRecord); { The activate event }
- c212,212
- c241,246
- c266,270
- a{****************************************************************************}
- c272,274
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoDeactivate (VAR macEvent: EventRecord); { The deactivate event }
- c240,246
- c284,287
- a{****************************************************************************}
- c289,292
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoSuspend (VAR macEvent: EventRecord); { The suspend event }
- c243,243
- c233,233
- a { Suspend the application }
- c233,233
- c299,302
- a{****************************************************************************}
- c304,307
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoResume (VAR macEvent: EventRecord); { The resume event }
- c243,243
- a { Resume the application }
- c242,242
- c313,315
- a{****************************************************************************}
- c317,323
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoOtherEvent (VAR macEvent: EventRecord); { The other event }
- c262,262
- a { NULL Method }
- c268,269
- a{****************************************************************************}
- c331,335
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoIdle (VAR macEvent: EventRecord); { Usually a null or system event }
- c262,262
- c339,343
- a{****************************************************************************}
- c345,354
- a{****************************************************************************}
- c356,357
- a macEvent: EventRecord; { Mac Event to be processed }
- a isMyEvent: Boolean; { Should program handle event? }
- a mouseLoc: Point; { Mouse location in global coords }
- c280,280
- c279,279
- a { Make sure our cursor shape and mouse region are set properly }
- a { before calling WaitNextEvent. We don't want to be stuck with }
- a { the wrong cursor shape if a minor switch occurs (i.e., a }
- a { background process get some cpu time). We also set the }
- a { cursor shape before handling an event. This ensures that the }
- a { the shape is correct even if the user performs some rapid }
- a { mouse movement and clicking. }
- c287,287
- c371,374
- a { Get an event from the queue }
- c287,287
- c377,380
- a ELSE { No action required }
- c382,383
- a{ We must respond to this event }
- c300,301
- a{****************************************************************************}
- c388,393
- a{****************************************************************************}
- c395,400
- a { WaitNextEvent is the preferred }
- a { call. It handles multitasking }
- a { in a friendly manner. }
- c312,312
- c405,407
- a ELSE { WaitNextEvent is not available. }
- c400,400
- a { We must use the old method of }
- a { calling SystemTask and }
- a { GetNextEvent. }
- c312,312
- c414,419
- a{****************************************************************************}
- c421,423
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DispatchEvent (VAR macEvent: EventRecord);
- c326,326
- c427,429
- a { USER ACTIONS }
- c329,329
- c432,446
- a { WINDOW MANAGER EVENTS }
- c341,341
- c449,461
- a { MULTIFINDER EVENTS }
- c362,362
- a osEvt:
- c465,495
- a{****************************************************************************}
- c497,505
- a{****************************************************************************}
- aPROCEDURE CSwitchboard.DoHighLevelEvent (VAR macEvent: EventRecord);
- c396,396
- c509,512
- a { +++ what to do with error? We return error codes in the}
- a { reply, but should the server app report an error?}
- a { client may either be this app, another app on this machine,}
- a { or an app on another machine. }
- c404,404
- c518,521
- a{****************************************************************************}
- c523,533
- a{****************************************************************************}
- aFUNCTION CSwitchboard.DoAppleEvent (VAR theEvent: AppleEvent;
- a VAR theReply: AppleEvent;
- c537,559
- a { Get the event class}
- c442,442
- c562,563
- a { Get the event ID }
- c445,445
- c566,569
- a { When the CAppleEvent is initialized, it sets its errorCode to }
- a { errAEEventNotHandled. If no one handles the event, the error code}
- a { will not be modified, and we will correctly signal that the}
- a { event wasn't handled. If it was handled successfully, then}
- a { whoever handled it should have marked it as such by calling}
- a { appleEvent.SetErrorResult( noErr). If an error occurred in handling}
- a { it, then either someone should have called }
- a { appleEvent.SetErrorResult( theError), or an exception occurred and}
- a { we pick up the error in the HandleFailure above. }
- c448,448
- c580,586
- a{****************************************************************************}
- c588,601
- a{****************************************************************************}
- aFUNCTION CSwitchboard.AppleEventIdle (VAR macEvent: EventRecord;
- c604,609
- a { make sure mouseRgn is up-to-date}
- c478,478
- c612,612
- a gDesktop.DispatchCursor(macEvent.where, self.mouseRgn);
- c478,478
- a { When DoIdle returns, gSleepTime is up-to-date }
- c480,480
- c617,622
- a mouseRgn := self.mouseRgn;
- c624,627
- aFUNCTION AppleEventHandler (VAR event: AppleEvent;
- a VAR reply: AppleEvent;
- c537,537
- c495,495
- c510,510
- c633,635
- aFUNCTION AppleEventIdleProc (VAR macEvent: EventRecord;
- a VAR sleepTime: Longint;
- a VAR mouseRgn: RgnHandle): Boolean;
- c517,517
- c510,510
- c641,644
- e
- fCTask.p
- x503803608,201812852
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,20
- a{**************************************************}
- c22,25
- a{**************************************************}
- c27,33
- a{**************************************************}
- c35,38
- a{**************************************************}
- c40,46
- a{**************************************************}
- c48,51
- a{**************************************************}
- c45,45
- c54,58
- a{**************************************************}
- c60,63
- a{**************************************************}
- c57,57
- c66,70
- a{**************************************************}
- c72,77
- a{**************************************************}
- c69,69
- c80,84
- a{**************************************************}
- c86,88
- a{**************************************************}
- c79,79
- c91,97
- e
- fCTextEditTask.p
- x284322898,308881020
- a{****************************************************************************}
- c1,17
- a{****************************************************************************}
- c19,28
- a{****************************************************************************}
- c30,40
- a{****************************************************************************}
- c42,92
- a{****************************************************************************}
- c94,98
- a{****************************************************************************}
- c100,111
- a{****************************************************************************}
- c113,118
- a{****************************************************************************}
- c120,121
- a VAR macEvent: EventRecord);
- c123,129
- a Assert(undone = FALSE);
- c131,147
- a{****************************************************************************}
- c149,153
- a{****************************************************************************}
- c155,160
- a{****************************************************************************}
- c162,166
- a{****************************************************************************}
- c168,178
- a { One of the following cases must hold: }
- a { - This is the first keystroke, and we have already }
- a { saved the selection, or the selection is empty. In }
- a { this case selStart == initialStart. }
- a { - We are in the middle of typing, and the selection }
- a { is guaranteed to be empty. If selStart > initialStart }
- a { then we are deleting new text and don't need to }
- a { save it. If selStart == deleted.start, we save the }
- a { character about to be deleted. selStart cannot be }
- a { less than initialStart because each backspace }
- a { decrements initialStart. }
- c178,178
- c191,192
- a { deleting new text }
- c178,178
- c195,197
- a { must be first key and text is already saved, }
- a { do nothing extra }
- c195,196
- c202,203
- a { deleting original text }
- c178,178
- c206,208
- a { was there a previous char? }
- c190,190
- c211,213
- a { resize the saved text handle, and copy new char into place }
- c190,190
- c216,229
- a{****************************************************************************}
- c231,234
- a{****************************************************************************}
- c236,248
- a { One of the following cases must hold: }
- a { - This is the first keystroke, and we have already }
- a { saved the selection, or the selection is empty. In }
- a { this case selStart == initialStart. }
- a { - We are in the middle of typing, and the selection }
- a { is guaranteed to be empty. Forward delete }
- a { only deletes old text. }
- c220,220
- c257,258
- a { must be first key and text is already saved, }
- a { just clear old text }
- c220,220
- c262,268
- a { was there a next char? }
- c229,229
- c271,273
- a { resize the saved text handle, and copy new char into place }
- c247,247
- c276,292
- a{****************************************************************************}
- c294,298
- a{****************************************************************************}
- c300,309
- a { deleted any inserted text }
- c311,312
- a { insert any deleted text, restore selection }
- c314,316
- a { restore the clipboard }
- c318,320
- a{****************************************************************************}
- c322,325
- a{****************************************************************************}
- c327,335
- a { re-delete the deleted text }
- c337,338
- a { re-insert the inserted text }
- c340,347
- a{****************************************************************************}
- c349,354
- a{****************************************************************************}
- c356,366
- a{****************************************************************************}
- c368,371
- a{****************************************************************************}
- c373,377
- a{****************************************************************************}
- c379,381
- a{****************************************************************************}
- c383,388
- a{****************************************************************************}
- c390,392
- a{****************************************************************************}
- c394,401
- a IF itsTextPane.itsTypingTask = self THEN
- c403,404
- a IF itsTextPane.itsLastTask = self THEN
- c406,411
- a{****************************************************************************}
- c413,415
- a{****************************************************************************}
- c417,433
- a{****************************************************************************}
- c435,437
- a{****************************************************************************}
- c439,447
- a{****************************************************************************}
- c449,452
- a{****************************************************************************}
- c454,482
- a{****************************************************************************}
- c484,487
- a{****************************************************************************}
- c489,502
- e
- fCTextStyleTask.p
- x136163665,86890147
- a{****************************************************************************}
- c1,20
- a{****************************************************************************}
- c22,31
- a{****************************************************************************}
- c33,35
- a{****************************************************************************}
- c37,46
- a{****************************************************************************}
- c48,51
- a{****************************************************************************}
- c53,57
- a IF itsTextPane.itsLastTask = self THEN
- c59,64
- a{****************************************************************************}
- c66,69
- a{****************************************************************************}
- c71,153
- a{****************************************************************************}
- c155,159
- a{****************************************************************************}
- c161,167
- a swapStyle := oldStyle; { save the current styling }
- c169,171
- a RestoreStyle; { restore the previous styling }
- a oldStyle := newStyle; { swap current and previous }
- c167,167
- c175,176
- a{****************************************************************************}
- c178,183
- a{****************************************************************************}
- c185,194
- a{****************************************************************************}
- c196,199
- a{****************************************************************************}
- c201,228
- e
- fCView.p
- x197447523,264669879
- a{****************************************************************************}
- c1,22
- a{****************************************************************************}
- c24,36
- a{****************************************************************************}
- c38,41
- a{****************************************************************************}
- aPROCEDURE CView.IView (anEnclosure: CView; { Enclosing display of this view }
- a aSupervisor: CBureaucrat); { Supervisor in the command chain }
- c45,46
- a IBureaucrat(aSupervisor); { Initialize superclass }
- a { Subclass should set the port }
- c49,49
- a { Store enclosing view }
- c51,52
- a { By default, views are invisible, }
- c54,54
- a { inactive, and }
- c56,56
- a { don't handle mouse clicks }
- c58,58
- a { and don't want to be gGopher }
- c60,61
- a { default ID is zero. It is up to }
- a { the programmer to provide IDs }
- a { and guarantee uniqueness. }
- c65,74
- a{****************************************************************************}
- c76,78
- a{****************************************************************************}
- aPROCEDURE CView.IViewRes (rType: ResType; { Resource Type of template }
- a resID: Integer; { Resource ID of template }
- a anEnclosure: CView; { Enclosing display of this view }
- a aSupervisor: CBureaucrat); { Supervisor in the command chain }
- c84,84
- a hRes: Handle; { Handle to resource template }
- c86,90
- a hRes := GetResource(rType, resID); { Load resource into memory }
- c69,69
- a FailNILRes(hRes); { Make sure resource exists }
- c69,69
- a HLock(hRes); { Lock resource in heap }
- c70,70
- a { Initialize View from template }
- c71,71
- c99,99
- a HUnlock(hRes); { Unlock resource }
- c101,105
- a{****************************************************************************}
- c107,109
- a{****************************************************************************}
- aPROCEDURE CView.IViewTemp (anEnclosure: CView; { Enclosing display of this view }
- a aSupervisor: CBureaucrat; { Supervisor in the command chain }
- a viewData: Ptr); { Template with View data }
- c84,84
- c115,116
- a { Initialize superclass }
- c92,92
- c119,130
- a{****************************************************************************}
- c132,134
- a{****************************************************************************}
- c136,137
- a { If this view has subviews ... }
- c139,140
- a { Throw them out }
- c142,144
- a IF (itsEnclosure <> NIL) THEN { Remove ourself from enclosure }
- c140,140
- a itsEnclosure.RemoveSubview(self);
- c144,144
- a IF (self = gLastViewHit) THEN { Don't leave a dangling pointer }
- c140,140
- c151,152
- a INHERITED Free; { Pass message on to superclass }
- c118,118
- c118,118
- c129,130
- a{****************************************************************************}
- c159,161
- a{****************************************************************************}
- c163,168
- a{****************************************************************************}
- c170,172
- a{****************************************************************************}
- c174,178
- a IF (gGopher = self) THEN
- c180,183
- a{****************************************************************************}
- c185,187
- a{****************************************************************************}
- c154,154
- a {)
- c191,191
- a{ }
- c193,194
- a { Make sure that View was active }
- a { and visible BEFORE its }
- a { enclosure was deactivate }
- a { Clear flag in case the Activate }
- a { method checks it }
- c200,215
- a{****************************************************************************}
- c217,219
- a{****************************************************************************}
- a {)
- c222,222
- a{ }
- c224,227
- a { We must save, then restore the }
- a { active flag so we can put }
- a { things back the way they were }
- a { upon a subsequent Activate. }
- c232,247
- a IF (gGopher = self) THEN
- c249,251
- a{****************************************************************************}
- c253,255
- a{****************************************************************************}
- c257,258
- a { Return instance variable }
- c206,206
- a IsVisible := self.visible;
- c205,206
- a{****************************************************************************}
- c265,268
- a{****************************************************************************}
- c270,282
- a{****************************************************************************}
- c284,286
- a{****************************************************************************}
- c288,297
- a{****************************************************************************}
- c299,305
- a{****************************************************************************}
- aPROCEDURE CView.DispatchClick (VAR macEvent: EventRecord); { Mouse down event record }
- c241,241
- a hitView: CView; { View in which mouse was clicked }
- a hitPt: Point; { In Frame coords of the view hit }
- c311,316
- a CountClicks(self, macEvent);
- a IF fCanBeGopher & (gGopher <> self) THEN
- c319,320
- a { if old gopher refuses to resign, then}
- a { we can't process this click}
- c323,330
- a hOff := qd.thePort^.portRect.left;
- a vOff := qd.thePort^.portRect.top;
- c324,324
- c334,343
- a{****************************************************************************}
- c345,367
- a{****************************************************************************}
- c369,372
- a { Null Method }
- c295,295
- c294,296
- a{****************************************************************************}
- c379,382
- a{****************************************************************************}
- aPROCEDURE CView.DoMouseUp (VAR macEvent: EventRecord); { Mouse up event record }
- c313,313
- a { Null Method }
- c342,343
- c343,343
- a{****************************************************************************}
- c391,395
- a{****************************************************************************}
- c343,343
- c343,343
- aPROCEDURE CView.DispatchCursor (where: Point; { View containing the mouse }
- a mouseRgn: RgnHandle); { Region containing the mouse }
- c343,343
- c308,308
- c403,414
- a {)
- c416,416
- a{ }
- c418,432
- a { See if mouse is within a subview }
- c343,343
- c435,435
- a IF (hitView = NIL) THEN { Mouse not within a subview }
- c339,339
- a { Calculate the uncovered area of }
- a { this View. }
- a { Start off with the aperture }
- a { in global coordinates }
- c343,343
- c443,448
- a { Now take intersection with the visRgn of View's }
- a { port. There could be something, such as a window, }
- a { floating above the View. Unfortunately, the visRgn }
- a { is the local coordinates and we need it to be in }
- a { global coords. Rather than making a copy and }
- a { offsetting to global coords, we temporily shift the }
- a { View's port so that its local coords are the same as }
- a { global coords. This saves us the overhead of making }
- a { a copy of the visRgn, which may take up a lot of }
- a { memory, at the expense of having to save and restore }
- a { the port and origin. }
- c374,374
- a { Save port and origin }
- c462,467
- a { visRgn is in Global coords now }
- c469,470
- a { Restore origin and port }
- c472,476
- a ELSE { Mouse is within a subview }
- c374,374
- c479,480
- a { If balloons are on and no one has shown a balloon, then do it now}
- a { This could either be because the mouse is not in a subview or because}
- a { no subview did help. This allows a group of panes to share the same help}
- a { balloon by putting the help info in their enclosing view}
- c374,374
- c486,495
- a{****************************************************************************}
- c497,499
- a{****************************************************************************}
- aPROCEDURE CView.AdjustCursor (where: Point; { Mouse location in Window coords }
- a mouseRgn: RgnHandle); { Region containing the mouse }
- c377,377
- c385,385
- a SetCursor(qd.arrow); { Use the standard arrow cursor }
- c388,388
- c387,388
- a{ Get the index of the 'hrct' resource to use for this view}
- a{ helpResIndex is the index into the resource}
- a{ the tip, alternate rect, and count parameters are not used}
- a{****************************************************************************}
- c513,518
- a{****************************************************************************}
- c520,541
- a { set mouse point to center of aperture }
- c414,414
- c544,555
- a{****************************************************************************}
- c557,580
- a{****************************************************************************}
- c582,592
- a cCurrHelpView := self;
- a IF (cLastHelpView <> self) & (helpData.hmmHelpType <> 0) THEN
- c487,487
- a { let this fail if there isn't enough memory}
- c460,460
- c598,610
- a{****************************************************************************}
- c612,617
- a{****************************************************************************}
- c619,620
- a { Return instance variable }
- c622,624
- a{****************************************************************************}
- c626,628
- a{****************************************************************************}
- c630,634
- a{****************************************************************************}
- c636,638
- a{****************************************************************************}
- c640,645
- a{****************************************************************************}
- c647,649
- a{****************************************************************************}
- c651,655
- a{****************************************************************************}
- c657,661
- a{****************************************************************************}
- c663,667
- a{****************************************************************************}
- c669,672
- a{****************************************************************************}
- c674,678
- a{****************************************************************************}
- c680,686
- a{****************************************************************************}
- c688,692
- a{****************************************************************************}
- c694,696
- a{****************************************************************************}
- c698,702
- a{****************************************************************************}
- c704,709
- a{****************************************************************************}
- c711,716
- a { No subview list exists, make one }
- c718,724
- a{****************************************************************************}
- c726,728
- a{****************************************************************************}
- c730,735
- a{****************************************************************************}
- c737,740
- a{****************************************************************************}
- c742,745
- a {)
- c747,747
- a{ }
- c749,759
- a { If view has no subview ... }
- a { No subview can be hit }
- c762,765
- a { Search backwards thru subviews }
- c604,604
- c768,770
- a { No subview hit OR the subview }
- a { hit does not process clicks }
- c773,775
- a { A willing view was hit }
- c610,610
- c778,781
- a{****************************************************************************}
- c783,790
- a{****************************************************************************}
- c792,806
- a { searching stops as soon as we find the first match }
- c645,645
- c809,815
- a { Don't care about return value, the view we want is returned in }
- a { foundView or it is NIL }
- c645,645
- a ignore := View_FindMatch(self);
- c820,823
- a{****************************************************************************}
- c825,827
- a{****************************************************************************}
- c829,839
- a{****************************************************************************}
- c841,844
- a{****************************************************************************}
- c846,847
- a { Null Method }
- c677,678
- a{****************************************************************************}
- c852,862
- a{****************************************************************************}
- c864,869
- a{****************************************************************************}
- c871,876
- a{****************************************************************************}
- aPROCEDURE CView.SubpaneLocation (hEncl, vEncl: Longint; { Point in View's coordinates }
- a VAR hLocation, vLocation: Longint); { Point in Window coordinates }
- c712,712
- c881,882
- a { Origin of the View }
- c702,702
- c885,886
- a { Convert point from View to }
- a { Window coordinates }
- c702,702
- c890,893
- a{****************************************************************************}
- c895,900
- a{****************************************************************************}
- c902,903
- a cPreparedView := self;
- c723,724
- c724,724
- a{****************************************************************************}
- c909,911
- a{****************************************************************************}
- c913,918
- a{****************************************************************************}
- c920,922
- a{****************************************************************************}
- c924,928
- a{****************************************************************************}
- c930,932
- a{****************************************************************************}
- c934,938
- a{****************************************************************************}
- c940,942
- a{****************************************************************************}
- c944,949
- a{****************************************************************************}
- c951,953
- a{****************************************************************************}
- c955,959
- a{****************************************************************************}
- c961,967
- a{****************************************************************************}
- c969,976
- e
- fCWindow.p
- x332776131,258064901
- a{****************************************************************************}
- c1,23
- a{****************************************************************************}
- c25,32
- a { Format of a WIND resource }
- c34,59
- a{*** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S ***}
- c58,59
- a{****************************************************************************}
- c64,66
- a{****************************************************************************}
- aPROCEDURE CWindow.IWindow (WINDid: Integer; { Window resource ID }
- a aFloating: Boolean; { Is this a floating window? }
- a anEnclosure: CDesktop; { Enclosing view of the window }
- a aSupervisor: CDirector); { Supervisor in chain of command }
- c72,72
- a theWIND: WINDtemplateH; { Handle to WIND resource template }
- a saveVis: Integer; { Original setting of visible flag }
- c75,76
- a { Initialize superclass. }
- c78,81
- a { Because we maintain our own window list and have to do }
- a { a lot of manual activating/deactivating to support }
- a { floating windows, it is imperative that windows be }
- a { invisible when initially created. Therefore, we read the }
- a { the WIND resource template and set the visible flag to }
- a { FALSE (after saving the original value). }
- c75,75
- c89,91
- a { Set floating window flag }
- c93,93
- a { Create Toolbox window record }
- c95,96
- a { If the WIND template had the }
- a { visible flag set to TRUE ... }
- c99,101
- a { Get handle to the WIND template }
- a { Call GetResource again since }
- a { it could have been purged }
- c105,105
- a { Reset flag to TRUE }
- c107,107
- a { Select will show the window and }
- a { make it the active one }
- c110,113
- a{****************************************************************************}
- c115,118
- a{****************************************************************************}
- c120,130
- a self.procID := aProcID;
- c132,137
- a{****************************************************************************}
- c139,141
- a{****************************************************************************}
- c143,145
- a { default resource ID for help balloon}
- a { 'hrct' resource}
- c148,149
- a { Stuff handle to window object }
- a { in reference constant field }
- a SetWRefCon(macPort, Longint(self));
- c153,154
- a { Let window grow as big as the }
- a { screen and as small as some }
- a { minimum size (a constant) }
- c127,127
- c159,159
- a { Offset the sizeRect to normalize the rect to 0,0 }
- a { Thanks to Bernie Bernstein for the fix }
- c162,165
- a { set to "invalid" location }
- c167,168
- a { Does not process activate click }
- c170,171
- a { Does handle mouse clicks }
- c173,174
- a { Stick window in our desktop }
- c137,137
- a CDesktop(itsEnclosure).AddWind(self);
- c136,137
- a{ Throw them out }
- a{****************************************************************************}
- c182,184
- a{****************************************************************************}
- c137,137
- c187,190
- a { Hide window first so the user }
- a { doesn't see the ugly details }
- a { as each subview is disposed }
- a self.Hide;
- c195,195
- a { If this window has subviews ... }
- c197,201
- a { Remove window from desktop }
- a CDesktop(itsEnclosure).RemoveWind(self);
- a { Clear dangling handle }
- c205,206
- a { Kill the Toolbox window stuff }
- c208,212
- a { Pass message on to superclass }
- c214,217
- a{****************************************************************************}
- c219,227
- a{****************************************************************************}
- aPROCEDURE CWindow.MakeMacWindow (WINDid: Integer); { Window resource ID }
- c230,236
- a { Floating windows are put in }
- a { front of all others, regulars }
- a { are put behind all others }
- c240,244
- a { Create a new Mac window }
- c246,254
- a{****************************************************************************}
- c256,264
- a{****************************************************************************}
- c266,289
- a{****************************************************************************}
- c291,293
- a{****************************************************************************}
- c295,296
- a CDirector(itsSupervisor).CloseWind(self);
- c253,254
- a{*** A C C E S S I N G M E T H O D S ***}
- c236,236
- a{****************************************************************************}
- c303,306
- a{****************************************************************************}
- c308,309
- a { Frame of Window includes a one }
- a { pixel border around its port }
- a { rectangle }
- c313,318
- a{****************************************************************************}
- c320,322
- a{****************************************************************************}
- c324,325
- a { Window interior is the same }
- a { size as its port rectangle }
- c328,333
- a{****************************************************************************}
- c335,340
- a{****************************************************************************}
- c280,280
- c343,350
- a{****************************************************************************}
- c352,354
- a{****************************************************************************}
- c356,357
- a { Return instance variable }
- c359,361
- a{****************************************************************************}
- c363,365
- a{****************************************************************************}
- c367,368
- a { Return instance variable }
- c370,372
- a{****************************************************************************}
- c374,376
- a{****************************************************************************}
- c378,379
- a { Return instance variable }
- c381,383
- a{****************************************************************************}
- c385,388
- a{****************************************************************************}
- c390,394
- a{****************************************************************************}
- c396,398
- a{****************************************************************************}
- c400,401
- a { Toolbox call does the work }
- c403,405
- a{****************************************************************************}
- c407,409
- a{****************************************************************************}
- c411,412
- a { Toolbox call does the work }
- c414,416
- a{****************************************************************************}
- c418,421
- a{****************************************************************************}
- c423,425
- a { Set instance variable }
- c427,429
- a{****************************************************************************}
- c431,433
- a{****************************************************************************}
- c435,436
- a { Return instance variable }
- c438,440
- a{****************************************************************************}
- c442,446
- a{****************************************************************************}
- c342,342
- c449,454
- a{****************************************************************************}
- c456,463
- a{****************************************************************************}
- c361,361
- c466,470
- a { Set instance variable }
- c472,472
- a { Check if window supports zooming }
- c474,476
- a { Get standard state rectangle }
- c478,480
- a { Adjust width }
- c482,486
- a { Adjust height }
- c488,493
- a{****************************************************************************}
- c495,499
- a{****************************************************************************}
- c501,508
- a{****************************************************************************}
- c510,514
- a{****************************************************************************}
- c516,520
- a{****************************************************************************}
- c522,524
- a{****************************************************************************}
- c526,530
- a{*** A P P E A R A N C E M E T H O D S ***}
- c416,416
- a{****************************************************************************}
- c534,536
- a{****************************************************************************}
- c416,416
- c539,540
- a { Do nothing if already visible }
- c542,543
- a { Superclass sets status }
- c545,545
- a { Tell desktop to make us visible }
- a CDesktop(itsEnclosure).ShowWind(self);
- c491,493
- a{****************************************************************************}
- c552,554
- a{****************************************************************************}
- c424,424
- c557,558
- a { Do nothing if already invisible }
- c560,561
- a { Superclass sets status }
- c563,563
- a { Tell desktop to hide us }
- a CDesktop(itsEnclosure).HideWind(self);
- c491,493
- a{****************************************************************************}
- c570,572
- a{****************************************************************************}
- c440,440
- c575,576
- a { Do nothing if already active }
- c578,579
- a { Hilite window's title bar }
- c581,582
- a { Let superclass set status }
- c584,585
- a { Notify supervisor }
- a CDirector(itsSupervisor).ActivateWind(self);
- c491,493
- a{****************************************************************************}
- c592,594
- a{****************************************************************************}
- c450,450
- c597,598
- a { Do nothing if already inactive }
- c600,601
- a { Unhilite title bar of window }
- c603,603
- a { Notify supervisor }
- a CDirector(itsSupervisor).DeactivateWind(self);
- a { Let superclass set status }
- c607,611
- a{****************************************************************************}
- c613,615
- a{****************************************************************************}
- c617,618
- a { Tell enclosure to select us }
- a CDesktop(itsEnclosure).SelectWind(self);
- c621,623
- a{****************************************************************************}
- c625,627
- a{****************************************************************************}
- c629,635
- a { Do nothing if already visible }
- c637,638
- a { Let superclass set status flags }
- c545,545
- a { Move window back to its original }
- a { location. The HideSuspend }
- a { method saved this location }
- a { before moving the window }
- a { offscreen. }
- c646,650
- a{****************************************************************************}
- c652,657
- a{****************************************************************************}
- c659,660
- a { Do nothing if already invisible }
- c560,561
- a { Let superclass set status flags }
- c563,563
- c666,667
- a { Save location of top left corner }
- a { of window in global coords }
- c670,675
- a{****************************************************************************}
- c677,681
- a{****************************************************************************}
- c520,520
- c684,690
- a{*** S I Z E A N D L O C A T I O N M E T H O D S ***}
- c520,520
- a{ Mouse down event for drag }
- a{ Desktop does the dragging }
- a{****************************************************************************}
- c696,698
- a{****************************************************************************}
- aPROCEDURE CWindow.Drag (VAR macEvent: EventRecord);
- c530,530
- c527,527
- a CDesktop(itsEnclosure).DragWind(self, macEvent);
- c529,530
- c530,530
- c530,530
- c530,530
- a{****************************************************************************}
- c710,712
- a{****************************************************************************}
- aPROCEDURE CWindow.Resize (VAR macEvent: EventRecord);
- c630,630
- c716,754
- a{****************************************************************************}
- c756,758
- a{****************************************************************************}
- c760,785
- a CDesktop(itsEnclosure).SelectWind(self);
- c610,611
- a{****************************************************************************}
- c790,795
- a{****************************************************************************}
- c797,807
- a{****************************************************************************}
- c809,813
- a{****************************************************************************}
- c815,839
- a{****************************************************************************}
- c841,844
- a{****************************************************************************}
- c846,864
- a{*** D R A W I N G M E T H O D S ***}
- c675,675
- c675,675
- c678,678
- c678,678
- a{****************************************************************************}
- c871,873
- a{****************************************************************************}
- c875,876
- a savePort: GrafPtr; { The current port }
- a updateRect: Rect; { Bounding box of update region }
- c686,686
- a GetPort(savePort); { Save the original port }
- c765,765
- a { This restricts the visible area }
- a { to just the update region, }
- a { meaning that no drawing will }
- a { occur outside this region }
- c886,886
- a { Clip to the entire window }
- a ClipRect(qd.thePort^.portRect);
- a { Erase the update region }
- a EraseRect(qd.thePort^.portRect);
- c830,831
- a { Draw all subviews }
- a updateRect := qd.thePort^.visRgn^^.rgnBBox;
- c895,896
- a EndUpdate(macPort); { End the update process }
- a SetPort(savePort); { Restore the original port }
- c690,690
- c836,836
- c692,692
- c704,705
- a{****************************************************************************}
- c905,907
- a{****************************************************************************}
- c701,701
- c910,916
- a{*** M O U S E M E T H O D S ***}
- c706,708
- a{****************************************************************************}
- c922,927
- a{****************************************************************************}
- c719,719
- aPROCEDURE CWindow.DispatchClick (VAR macEvent: EventRecord); { Mouse down event record }
- c720,720
- a Prepare; { Use Window's port and coords }
- a { Convert mouse location in event }
- a { record to window coords }
- c935,935
- a { Let superclass process the event }
- c937,941
- a{****************************************************************************}
- c943,947
- a{****************************************************************************}
- c730,730
- aPROCEDURE CWindow.DispatchCursor (where: Point; { Mouse location in global coords }
- a mouseRgn: RgnHandle); { Region containing the mouse }
- c761,761
- c953,954
- a { Convert point to Window coords }
- c735,735
- c957,960
- a { Let superclass take over }
- c962,964
- a{****************************************************************************}
- c966,968
- a{****************************************************************************}
- c747,747
- c971,980
- a{ Functions passed as arguments to CList methods }
- c754,754
- c763,763
- a{**************************************************}
- c985,988
- a{**************************************************}
- c763,763
- c991,997
- a{**************************************************}
- c999,1002
- a{**************************************************}
- c773,773
- c1005,1011
- a{**************************************************}
- c1013,1016
- a{**************************************************}
- c784,784
- c1019,1025
- a{**************************************************}
- c1027,1030
- a{**************************************************}
- c804,804
- c1033,1039
- a{**************************************************}
- c1041,1044
- a{**************************************************}
- c818,818
- c1047,1053
- a{**************************************************}
- c1055,1058
- a{**************************************************}
- c839,839
- c1061,1067
- e
- fExceptions.p
- x213215847,306224579
- c0,18
- aUSES Types, Memory, Errors, Resources, Processes;
- c19,34
- a A6Link: Longint;
- a handlerType: SignedByte;
- a fPropagate: Boolean;
- a pad: integer;
- a handlerProc: ProcPtr;
- a next: FailInfoPtr;
- a{$IFC MAC68K}
- a regs: ARRAY[1..13] OF Longint;
- a{$ELSEC}
- a regs: ARRAY[1..60] OF Longint;
- c184,184
- c41,69
- c76,76
- c68,69
- c71,72
- aUSES TCL;
- c70,70
- c73,75
- c79,208
- a{$PUSH}
- a{$Z+}
- aPROCEDURE MyFailure ( e : INTEGER; m : LONGINT;
- a PROCEDURE Handler(e : INTEGER; m : LONGINT));
- aBEGIN
- a Handler(e,m);
- aEND;
- a{$POP}
- c206,206
- c209,321
- c13,13
- c322,322
- e
- o
- rDialog classes
- fCDialog.p
- x249562772,471054042
- a{****************************************************************************}
- c1,18
- a{****************************************************************************}
- c20,30
- a kScrollSteps = 10; { default step value used when creating }
- a { a scrollpane for the dialog }
- c29,29
- c33,33
- a{****************************************************************************}
- c36,39
- a{****************************************************************************}
- c41,49
- a{****************************************************************************}
- c51,54
- a{****************************************************************************}
- c56,67
- a{****************************************************************************}
- c69,71
- a{****************************************************************************}
- c73,79
- a{****************************************************************************}
- c81,83
- a{****************************************************************************}
- c85,92
- a { only enable autscrolling if both scroll bars are present }
- c82,82
- c95,97
- a enclosure := self;
- c99,101
- a scrollPane.IScrollPane(self, self, 0, 0, 0, 0, sizELASTIC, sizELASTIC, fHasHScroll, fHasVScroll, fHasSizeBox);
- c103,109
- a itsPanorama.IPanorama(enclosure, self, 0, 0, 0, 0, sizELASTIC, sizELASTIC);
- c111,121
- a{****************************************************************************}
- c123,128
- a{****************************************************************************}
- c130,131
- a VAR macEvent: EventRecord);
- c133,155
- a{****************************************************************************}
- c157,162
- a{****************************************************************************}
- c164,194
- a IF (gopherInfo^.firstGopher = NIL) THEN { firstGopher is nil only before }
- a { we hit the first gopher }
- c177,177
- c198,198
- a { always update last gopher because }
- a { we can't tell which is last until }
- a { we're done }
- c202,203
- a IF gopherInfo^.hitCurrent & (gopherInfo^.nextGopher = NIL) THEN { after we hit the current gopher, }
- a { the first one we find is the next }
- a { gopher. }
- c180,180
- c208,209
- a { flag when we hit the current }
- a { gopher so we can watch for the }
- a { next one. }
- c213,215
- a IF (NOT gopherInfo^.hitCurrent) THEN { keep updating the prev gopher }
- a gopherInfo^.prevGopher := aView; { until we hit the current gopher }
- c185,185
- c219,219
- a { recursively search subviews }
- c221,225
- a{****************************************************************************}
- c227,235
- a{****************************************************************************}
- c237,248
- a { if no next gopher, wrap around to first }
- c250,251
- a { if no prev gopher, wrap around to last }
- c253,259
- a{****************************************************************************}
- c261,265
- a{****************************************************************************}
- c267,283
- a{****************************************************************************}
- c285,288
- a{****************************************************************************}
- c290,296
- a{****************************************************************************}
- c298,302
- a{****************************************************************************}
- c304,313
- a { returns TRUE if aPane is a CDialogText and it failed validation }
- c271,271
- c316,338
- a{****************************************************************************}
- c340,343
- a{****************************************************************************}
- c345,355
- a{****************************************************************************}
- c357,361
- a{****************************************************************************}
- c363,375
- a{****************************************************************************}
- c377,380
- a{****************************************************************************}
- c382,396
- a{****************************************************************************}
- c398,401
- a{****************************************************************************}
- c403,415
- a { get the pane's frame and convert it to the coordinates }
- a { of the dialog panorama, which does the scrolling }
- c364,364
- c419,425
- a itsPanorama.GetPosition(position); { get the current scroll position }
- c427,428
- a { grow the frame rectangle a little so we always have a little }
- a { whitespace around the pane }
- c375,375
- c432,433
- a {*** calc vertical scroll ***}
- c375,375
- a { Is the top of the pane below the bottom of the frame? }
- c396,396
- c438,443
- a { Is the bottom of the pane above the top of the frame? }
- c396,396
- c446,450
- a {*** calc horizontal scroll ***}
- c396,396
- a { Is the left edge of the pane past the right edge of frame? }
- c396,396
- c455,460
- a { Is the right edge of the pane before the left edge of frame? }
- c415,415
- c463,467
- a { scroll to new position of necessary }
- c415,415
- c470,474
- a{****************************************************************************}
- c476,481
- a{****************************************************************************}
- c415,415
- c484,496
- e
- fCDialogDirector.p
- x101605399,528952795
- a{****************************************************************************}
- c1,12
- a{****************************************************************************}
- c14,23
- a{****************************************************************************}
- c25,28
- a{****************************************************************************}
- c30,36
- a{****************************************************************************}
- c38,42
- a{****************************************************************************}
- c44,57
- a{****************************************************************************}
- c59,62
- a{****************************************************************************}
- c64,66
- a Assert(member(itsWindow, CDialog));
- c66,66
- c69,72
- a{****************************************************************************}
- c74,80
- a{****************************************************************************}
- c82,99
- a { Setup the desired default command, and make sure the window }
- a { is modal and visible }
- c96,96
- c103,107
- a { Since we just disabled the gopher's menus out from under it,}
- a { we need to trick it into becoming the gopher again.}
- c96,96
- c111,111
- a ignore := self.BecomeGopher(TRUE);
- c113,114
- a { post an exception handler to prevent exceptions from }
- a { prematurely aborting the dialog }
- c99,99
- c118,130
- a{****************************************************************************}
- c132,135
- a{****************************************************************************}
- c137,142
- a{****************************************************************************}
- c144,147
- a{****************************************************************************}
- c149,154
- a{****************************************************************************}
- c156,160
- a{****************************************************************************}
- c162,183
- a{****************************************************************************}
- c185,188
- a{****************************************************************************}
- c190,207
- a{****************************************************************************}
- c209,213
- a{****************************************************************************}
- c215,227
- e
- fCDialogText.p
- x335290214,156303652
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,24
- a kBorderAmount = 2; { white space between border and text of edit field }
- c24,24
- a{****************************************************************************}
- c28,33
- a{****************************************************************************}
- c35,50
- a{****************************************************************************}
- c52,54
- a{****************************************************************************}
- c56,72
- a{****************************************************************************}
- c74,76
- a{****************************************************************************}
- c78,83
- a{****************************************************************************}
- c85,88
- a{****************************************************************************}
- c90,102
- a{****************************************************************************}
- c104,108
- a{****************************************************************************}
- c110,117
- a{****************************************************************************}
- c119,123
- a{****************************************************************************}
- c125,126
- a VAR macEvent: EventRecord);
- c128,146
- a theID := self.ID;
- c148,155
- a{****************************************************************************}
- c157,160
- a{****************************************************************************}
- c162,174
- a{****************************************************************************}
- c176,182
- a{****************************************************************************}
- c184,193
- a IF (isRequired & (textLength = 0)) THEN
- c195,209
- a{****************************************************************************}
- c211,213
- a{****************************************************************************}
- c215,228
- a{****************************************************************************}
- c230,233
- a{****************************************************************************}
- c235,244
- a { if we are resigning the gopher and validation is requested }
- a { then do the validation before calling inherited method }
- a { note that we don't validate if window is not visible }
- c226,226
- c249,272
- e
- fCDLOGDialog.p
- x292465399,391680627
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,23
- a {MethTableUtils;} TextUtils;
- c22,22
- c26,27
- a { constants for control types in dialog template }
- c25,25
- c30,57
- a{$IFC MAC68K}
- c58,61
- a{$ELSEC}
- aBEGIN
- a ByteAsUnsigned := band(sb,$00FF);
- aEND;
- a{$ENDC}
- c62,62
- a{****************************************************************************}
- c65,67
- a{****************************************************************************}
- c62,62
- c70,78
- a staticTextFont := 0; { use the system font }
- c80,80
- a staticTextSize := 0; { use TE's default size }
- c82,82
- a defaultBorderPen := 1; { default to border of 1 pixel }
- c84,84
- a { Get the DLOG resource template }
- c84,84
- c87,89
- a { Get window size from the template }
- c91,93
- a { If the procID is documentProc or zoomDocProc then give the window }
- a { horizontal and vertical scroll bars and a size box. }
- c96,103
- a { Get the window title from the template }
- c105,107
- a { Get the DITL resource and create all the dialog items }
- c93,93
- c110,113
- a{****************************************************************************}
- c115,120
- a{****************************************************************************}
- c122,150
- a { Get the DITL item list }
- c138,138
- c153,158
- a { index of last item in list }
- c145,145
- c161,162
- a { point to the first DITL item }
- c145,145
- c165,166
- a { iterate over all the items in the DITL resource }
- a { and create the TCL panes on the fly }
- c147,147
- c170,172
- a { Is this item disabled? }
- c150,150
- c175,176
- a { Get size of the item, and the pad it for word }
- a { alignment if necessary }
- c158,158
- c180,183
- a { Find the "best fit" enclosure for the new item }
- c158,158
- c186,187
- a { Get the dimensions for the new item }
- c162,162
- c190,192
- a { If the enclosure for the new item is not the dialog }
- a { itself, then we should transform the top left to the }
- a { enclosure's coordinates. Note that the item rect in }
- a { ditlItem is passed unmodified to the item creation }
- a { methods. }
- c166,166
- c166,166
- c200,201
- a { Case on the item type. We must strip off the }
- a { enable bit to do so. }
- c169,169
- c172,172
- c206,206
- a userItem: { User Items }
- c208,208
- a kBtnCtrl: { Push Buttons }
- c210,210
- a kChkCtrl: { Check boxes }
- c212,212
- a kRadCtrl: { Radio Buttons }
- c214,214
- a kResCtrl: { 'CNTL' Resource Controls }
- c216,216
- a statText: { Static text }
- c218,218
- a editText: { Edit text }
- c220,220
- a iconItem: { Icons }
- c222,222
- a picItem: { Pictures }
- c224,229
- a { Set the view ID of the new dialog item to its index in the DITL + }
- a { the base ID supplied by the caller. }
- c232,244
- a{****************************************************************************}
- c246,252
- a{****************************************************************************}
- c254,263
- a { first check if the current view encloses the rect }
- a { if it does, then check if any subview encloses it }
- c235,235
- c267,271
- a { save the most specific view that encloses the rect, }
- a { either a subview of this view, or this view }
- c235,235
- c275,294
- a { If anyView is not nil, then some subview encloses }
- a { the rect. However, there may be a view nested within }
- a { anyView that completely encloses the rect. }
- a { foundView returns the best view }
- c243,243
- c300,301
- a { if no subview was found that completely encloses boundsRect }
- a { then the enclosure defaults to the dialog panorama }
- c257,257
- c305,310
- a{ make a copy of the button title }
- a{ ask the bartender to parse this string for us. }
- a{****************************************************************************}
- c314,316
- a{****************************************************************************}
- c318,333
- a btn.INewButton(aWidth, aHeight, hEncl, vEncl, titleStr, TRUE, pushButProc, enclosure, self);
- c335,339
- a{****************************************************************************}
- c341,343
- a{****************************************************************************}
- c345,355
- a Assert(member(enclosure, CRadioGroupPane));
- c357,364
- a{****************************************************************************}
- c366,368
- a{****************************************************************************}
- c370,382
- a check.INewCheckBox(aWidth, aHeight, hEncl, vEncl, titleStr, TRUE, enclosure, self);
- c384,387
- a{****************************************************************************}
- c389,391
- a{****************************************************************************}
- c393,403
- a{ first check for overloading of static text items }
- a{ overloading is signalled by a first character of '@' }
- a{****************************************************************************}
- c407,413
- a{****************************************************************************}
- c415,438
- a text.IEditText(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY, -1);
- c440,452
- a{****************************************************************************}
- c454,458
- a{*****************************************************************************}
- c460,473
- a text.IDialogText(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY, -1);
- c475,486
- a{****************************************************************************}
- c488,490
- a{****************************************************************************}
- c492,501
- a icon.IIconPane(enclosure, self, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY, ditlItem^.itemData[0], TRUE);
- c503,505
- a{****************************************************************************}
- c507,509
- a{****************************************************************************}
- c511,520
- a pict.IPicture(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY);
- a { pass resource ID of PICT }
- c523,526
- a{****************************************************************************}
- c528,531
- a{****************************************************************************}
- c533,545
- a pane.IPane(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY);
- c547,554
- a{****************************************************************************}
- c556,587
- a{****************************************************************************}
- aFUNCTION NewByName(s:string):Handle; EXTERNAL;
- c505,505
- a FUNCTION CDLOGDialog.AddOverloadedItem (itemText: Str255;
- c590,624
- a { collect the class name, resource type and ID}
- c544,544
- c627,645
- a { get the resource, save the location and size, then}
- a { restore it after the pane is created.}
- c554,554
- c649,659
- a { now make the pane}
- c596,596
- c662,666
- a Assert(member(newPane, CPane));
- c596,596
- a newPane.IViewRes(rType, resID, enclosure, self);
- c670,673
- a ELSE IF (itemText[1] = '#') THEN { Create a CIntegerText}
- c623,623
- c676,676
- a text.IIntegerText(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY, -1);
- c678,687
- a { check if string not exhausted and have another '#' }
- c596,596
- c690,691
- a index := index + 1; { move past delimiter}
- c693,701
- a ELSE IF (itemText[1] = '!') THEN { Create a CDialogText with constraints}
- c623,624
- c705,709
- a dlgText.IDialogText(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY, -1);
- c711,714
- a { if next char is another '!', make this a required field}
- c716,720
- a { next text, if any, is max number of chars, no}
- a { trailing delimiter is required, just collect until end of string}
- c618,618
- c724,732
- a group.IRadioGroupPane(enclosure, self, aWidth, aHeight, hEncl, vEncl, sizFIXEDSTICKY, sizFIXEDSTICKY);
- c631,631
- c735,766
- e
- fCDLOGDirector.p
- x403282096,630890
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,26
- a{****************************************************************************}
- c28,31
- a{****************************************************************************}
- c33,42
- a dialog.IDLOGDialog(DLOGid, gDesktop, self);
- c44,47
- e
- fCIntegerText.p
- x298969365,532904079
- a{****************************************************************************}
- c1,30
- a{****************************************************************************}
- c32,41
- a{****************************************************************************}
- c46,50
- a{****************************************************************************}
- c52,65
- a{****************************************************************************}
- c67,69
- a{****************************************************************************}
- c65,65
- c72,84
- a { As a special case, we interpret that }
- a { if minValue == maxValue, the intent is to allow all integers }
- c79,79
- c88,98
- a{****************************************************************************}
- c100,103
- a{****************************************************************************}
- c105,106
- a Assert(aMaximum > aMinimum);
- c108,110
- a { if range is MINLONG, MAXLONG then any integral entry is}
- a { allowed, so don't display the acceptable range in the error alert}
- c98,98
- c114,116
- a{****************************************************************************}
- c118,121
- a{****************************************************************************}
- c123,128
- a{****************************************************************************}
- c130,132
- a{****************************************************************************}
- c134,135
- a numStr, oldText: Str255;
- c116,116
- c124,124
- c143,143
- c128,128
- a NumToString(aValue, numStr);
- c128,128
- c151,155
- a{****************************************************************************}
- c157,159
- a{****************************************************************************}
- c161,169
- a{****************************************************************************}
- c171,174
- a{****************************************************************************}
- c176,207
- a{****************************************************************************}
- c209,212
- a{****************************************************************************}
- c214,217
- c219,219
- c207,207
- c225,234
- a valid := TRUE;
- a StringToNum(str, intValue);
- c204,204
- c206,207
- c256,256
- e
- fTCL_Dialogs.p
- x201322237,518036801
- c0,0
- a{****************************************************************************}
- c2,9
- a{****************************************************************************}
- c11,20
- a kDialogPanoramaID = 'pano'; { view ID of dialog panorama}
- a kDialogScrollPaneID = 'scpn'; { view ID of dialog scroll pane, if any}
- c20,20
- c24,37
- a defaultBtn: CButton; { current default button }
- a itsPanorama: CPanorama; { panorama that encloses all dialog items }
- a scrollable: Boolean; { TRUE if autoscrolling is enabled. This }
- a { is the case when itsPanorama is enclosed }
- a { in a scroll pane. }
- c34,34
- c44,58
- a VAR macEvent: EventRecord);
- c60,79
- a{****************************************************************************}
- c81,82
- a{****************************************************************************}
- c78,78
- c85,87
- a dismissCmd: Longint; { command that dismissed the dialog }
- c78,78
- c90,104
- a{****************************************************************************}
- c106,107
- a{****************************************************************************}
- c103,104
- c111,113
- a isRequired: Boolean; { TRUE if must be non-empty to be valid }
- c115,115
- a maxValidLength: Longint; { maximum number of chars for validation }
- c103,103
- c118,134
- a VAR macEvent: EventRecord);
- c130,130
- c137,145
- a { View Template for DialogText }
- c145,145
- c148,157
- a{ indices into STR# 133 for validation constrain errors }
- c145,145
- a validateFieldIsRequired = 1; { required field was left blank }
- a validateFieldTooLong = 2; { field's length exceeds its maximum }
- c145,145
- c145,145
- a{ Change propagation constants for CDialogText }
- c145,145
- c145,145
- a dialogTextChanged = bureaucratLastChange + 1; { indicates the text has changed in some way }
- a dialogTextLastChange = dialogTextChanged; { info parameter is pointer (IntegerPtr) }
- a { to pane ID }
- c145,145
- c145,145
- a{****************************************************************************}
- c173,174
- a{****************************************************************************}
- c155,155
- c155,155
- a { item data }
- c179,180
- a itemHndl: Handle; { Handle or procedure pointer for this item }
- a itemRect: Rect; { Display rectangle for this item }
- a itemType: SignedByte; { Item type for this item — 1 byte }
- a itemLength: SignedByte; { Length of data }
- c185,191
- a staticTextFont: Integer; { default font to use for static text items }
- a staticTextSize: Integer; { default size to use for static text items }
- a editTextFont: Integer; { default font for edit text items }
- a editTextSize: Integer; { default size for edit text items }
- a defaultBorderPen: Integer; { default border thickness for user items }
- a { and RadioGroupPanes }
- c159,159
- c199,238
- a{****************************************************************************}
- c240,241
- a{****************************************************************************}
- c243,249
- a{****************************************************************************}
- c251,252
- a{****************************************************************************}
- c238,238
- c238,238
- c243,243
- c257,258
- a minValue: Longint; { minimum valid value }
- a maxValue: Longint; { maximum valid value }
- a defaultValue: Longint; { default value if text empty. If }
- a { CDialogText.isRequired is FALSE, then}
- a { empty text is considered valid and default}
- a { value is returned by GetIntValue.}
- a showRangeOnErr: Boolean; { If TRUE, validation error displays allow }
- a { range of integers in the alert}
- c238,238
- c268,300
- a { indices into validation error STR# resource for CInteger text }
- c254,254
- a validateIntFailed = 3; { text not integer or out of range }
- a validateIntRangeFailed = 4; { same, but display allowed range in alert }
- c254,254
- c306,312
- e
- o
- rFW/Tearoffs
- fCCharGrid.p
- x454571738,82187498
- a{**************************************************}
- c1,13
- a{**************************************************}
- c15,47
- a{**************************************************}
- c49,52
- a{**************************************************}
- c54,92
- a{**************************************************}
- c94,97
- a{**************************************************}
- c99,101
- a DisposeHandle(Handle(theCharacters)); {Get rid of list of characters }
- c103,106
- a{**************************************************}
- c108,111
- a{**************************************************}
- c105,105
- c114,128
- e
- fCFWDesktop.p
- x216991098,457343156
- a{**************************************************}
- c1,11
- a{**************************************************}
- c13,18
- a TCL, FW_Tearoffs, CWindow, LowMem;
- c17,17
- c20,20
- c22,24
- a{* Class Constant *}
- c23,23
- c27,30
- a{**************************************************}
- c32,35
- a{**************************************************}
- c37,51
- a{**************************************************}
- c53,56
- a{**************************************************}
- c50,50
- c59,64
- a DisposePtr(Ptr(macPort)); { assocated data structures }
- c58,58
- c67,70
- a{**************************************************}
- c72,76
- a{**************************************************}
- c69,69
- c79,102
- a{**************************************************}
- c104,107
- a{**************************************************}
- c97,97
- c110,118
- a{**************************************************}
- c120,123
- a{**************************************************}
- c117,117
- c126,137
- a{**************************************************}
- c139,142
- a{**************************************************}
- c130,130
- c145,256
- a LMSetCurActivate(NIL); { Nuke any pending activate event }
- c258,261
- a{**************************************************}
- c263,266
- a{**************************************************}
- c248,248
- c269,281
- a{**************************************************}
- c283,286
- a{**************************************************}
- c268,268
- c289,301
- a{**************************************************}
- c303,306
- a{**************************************************}
- c288,288
- c309,309
- a VAR macEvent: EventRecord);
- c311,366
- a{**************************************************}
- c368,371
- a{**************************************************}
- c347,347
- c374,384
- a{**************************************************}
- c386,389
- a{**************************************************}
- c362,362
- c392,402
- a{**************************************************}
- c404,408
- a{**************************************************}
- c383,383
- c411,422
- a{**************************************************}
- c424,428
- a{**************************************************}
- c401,401
- c431,442
- a{**************************************************}
- c444,447
- a{**************************************************}
- c421,421
- c450,463
- a{**************************************************}
- c465,468
- a{**************************************************}
- c441,441
- c471,476
- a{**************************************************}
- c478,493
- a{**************************************************}
- c456,456
- c496,560
- e
- fCGridSelector.p
- x309060851,36888201
- a{**************************************************}
- c1,11
- a{**************************************************}
- c13,24
- a{**************************************************}
- c26,29
- a{**************************************************}
- c31,65
- a{**************************************************}
- c67,70
- a{**************************************************}
- c72,97
- a{**************************************************}
- c99,102
- a{**************************************************}
- c96,96
- c105,107
- c109,115
- c117,142
- a{**************************************************}
- c144,148
- a{**************************************************}
- c141,141
- c151,166
- a{**************************************************}
- c168,172
- a{**************************************************}
- c165,165
- c175,195
- a{**************************************************}
- c197,200
- a{**************************************************}
- c187,187
- c203,226
- a{**************************************************}
- c228,232
- a{**************************************************}
- c225,225
- c235,240
- a{**************************************************}
- c242,245
- a{**************************************************}
- c234,234
- c248,254
- e
- fCMenuDefProc.p
- x101322953,475211470
- a{**************************************************}
- c1,12
- a{**************************************************}
- c14,24
- a{$IFC POWERPC}
- aUSES MixedMode;
- c24,24
- aPROCEDURE BuildRoutineDescriptor(
- a VAR aDescriptor : RoutineDescriptor;
- a procInfo : ProcInfoType;
- a theProc : MenuDefProcPtr); C; EXTERNAL;
- c24,24
- a{$ENDC}
- c25,25
- a{**************************************************}
- c27,30
- a{**************************************************}
- c32,40
- a{$IFC MAC68K}
- c41,42
- a theMDEFP^.itsMenuDefProc := self;
- c44,45
- a{$ELSEC}
- a { Create a MenuDefUPP for PowerPC builds… }
- a SetHandleSize(Handle(theMDEF), sizeof(GenericMDEFRec));
- a BuildRoutineDescriptor(theMDEF^^.defProc, uppMenuDefProcInfo, @GenericMDEF);
- a theMDEF^^.itsMenuDefProc := self;
- a{$ENDC}
- c46,48
- a{**************************************************}
- c50,54
- a{**************************************************}
- c56,62
- a{**************************************************}
- c64,68
- a{**************************************************}
- c70,79
- a{**************************************************}
- c81,85
- a{**************************************************}
- c78,78
- c88,98
- a{**************************************************}
- c100,104
- a{**************************************************}
- c97,97
- c107,115
- e
- fCPaneMDEF.p
- x274999569,326631149
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,30
- a TEARMARGIN = 10; { Margin for tearing off a menu }
- a TEARWAIT = 6; { Ticks to delay while dragging }
- a FRAME_WIDTH = 1; { Thickness of window frame }
- a DRAG_WIDTH = 10; { Thickness of window drag bar }
- c30,30
- a{****************************************************************************}
- c37,39
- a{****************************************************************************}
- c41,43
- a { Initialize superclass }
- c42,42
- c46,51
- a{****************************************************************************}
- c53,56
- a{****************************************************************************}
- c58,59
- a paneFrame: LongRect; { Frame of pane to be drawn }
- c61,63
- a itsPane.GetFrame(paneFrame); { Set up pane's drawing environs }
- a LongToQDRect(paneFrame, qdFrame); { Draw pane inside the menu }
- c66,68
- a { Check if the entire menu is disabled. If so, the menu }
- a { should be drawn in gray. We draw in gray by BIC'ing }
- a { a gray pattern over the entire pane. }
- c68,68
- c73,74
- a PenMode(patBic); { ??? Should selections be }
- a PenPat(qd.gray); { unhilited? }
- c77,83
- a{****************************************************************************}
- c85,88
- a{****************************************************************************}
- c90,93
- a { Get dimensions of its pane }
- c80,80
- c96,105
- a{****************************************************************************}
- c107,109
- a{****************************************************************************}
- a procedure CPaneMDEF.TearOffMenu (menuRect: Rect; { Bounding box of menu }
- a mouseLoc: Point); { Mouse location }
- c91,91
- c95,95
- a margins: Rect; { Margins around menu rectangle }
- a tearRect: Rect; { Current location of tear off }
- a grayPat: Pattern; { Gray pattern for dragging }
- a ticks: Longint; { Tick count after delay }
- c93,93
- c95,95
- a { Tear off occurs only when the }
- a { mouse is in certain places }
- c95,95
- c124,125
- a { Prepare to tear off the menu }
- a { by dragging a gray outline }
- a { of the menu }
- c129,129
- a PenPat(qd.gray);
- a PenMode(patXor); { Toggle gray rect on the screen }
- c132,134
- a { Seize control until the mouse }
- a { is released or leaves the }
- a { valid tear off region }
- c100,100
- a { Make a rectangle which is the }
- a { same size as the window which }
- a { holds the tear off menu }
- c100,100
- c143,148
- a { Drawing and then undrawing a gray outline at }
- a { the current location gives the illlusion of }
- a { dragging the tear off menu }
- c114,114
- c114,114
- a FrameRect(tearRect); { Draw the gray outline }
- a Delay(TEARWAIT, ticks); { Wait a while }
- a FrameRect(tearRect); { Undraw the gray outline }
- a GetMouse(mouseLoc); { Check current mouse location }
- c114,114
- c114,114
- c160,161
- a PenNormal; { Restore normal pen state }
- c114,114
- a { Check reason for loop exit }
- a { region }
- c114,114
- c167,168
- a { Mouse released inside tear off }
- c170,178
- a{****************************************************************************}
- c180,182
- a{****************************************************************************}
- a function CPaneMDEF.PtInTearRgn (hitPt: Point; { Mouse location }
- a menuRect: Rect): Boolean; { Bounding box of menu }
- c138,138
- c187,188
- a { Valid tear off region: Mouse is not in the menu bar and }
- a { at least TEARMARGIN pixels from the left, right, or bottom }
- a { sides of the menu. }
- c138,138
- c193,198
- a{****************************************************************************}
- c200,202
- a{****************************************************************************}
- c204,206
- a newOrigin: Point; { New origin for pane }
- a desktopBounds: Rect; { Boundaries of the desktop }
- c209,211
- a GetPort(savePort); { Save the current port }
- a gDesktop.Prepare; { Draw into our Desktop's port }
- c148,148
- a itsPane.GetFrame(paneFrame); { Get size of pane and Desktop }
- c216,218
- a tsaveClip := NewRgn; { Save clipping region of Desktop }
- c220,222
- a { Pane will be drawn in Desktop's }
- a { port rather than its own, so }
- a { we must adjust the pane's }
- a { origin accordingly }
- c158,158
- c228,231
- a { Pane's frame corresponds to the }
- a { menu rectangle, so make sure }
- a { we don't draw outside the menu }
- c159,159
- c236,239
- a{****************************************************************************}
- c241,243
- a{****************************************************************************}
- c172,172
- c246,250
- a { Restore origin and clipping }
- a { region of our desktop }
- c173,173
- c217,217
- c255,262
- e
- fCPatternGrid.p
- x139780108,250984778
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,32
- a{** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S **}
- c31,32
- c34,34
- a{**************************************************}
- c38,41
- a{**************************************************}
- c43,66
- a{**************************************************}
- c68,71
- a{**************************************************}
- c66,66
- c74,75
- a DisposeHandle(Handle(thePatterns)); { Get rid of list of pattern ID's }
- c77,80
- a{**************************************************}
- c82,85
- a{**************************************************}
- c79,79
- c88,97
- a{**************************************************}
- c99,102
- a{**************************************************}
- c96,96
- c105,123
- a PenPat(qd.white);
- c125,157
- a{**************************************************}
- c159,162
- a{**************************************************}
- c156,156
- c165,171
- e
- fCSelector.p
- x68761416,437858804
- a{**************************************************}
- c1,11
- a{**************************************************}
- c13,23
- a{**************************************************}
- c25,28
- a{**************************************************}
- c30,45
- a{**************************************************}
- c47,53
- a{**************************************************}
- c55,78
- a{**************************************************}
- c80,84
- a{**************************************************}
- c78,78
- c87,98
- a{**************************************************}
- c100,104
- a{**************************************************}
- c97,97
- c107,120
- a{**************************************************}
- c122,125
- a{**************************************************}
- c119,119
- c128,133
- a{**************************************************}
- c135,140
- a{**************************************************}
- c132,132
- c143,148
- a{**************************************************}
- c150,155
- a{**************************************************}
- c142,142
- c158,163
- a{**************************************************}
- c165,169
- a{**************************************************}
- c157,157
- c172,177
- a{**************************************************}
- c179,183
- a{**************************************************}
- c171,171
- c186,191
- a{**************************************************}
- c193,199
- a{**************************************************}
- c185,185
- c202,207
- e
- fCSelectorMDEF.p
- x356713452,344053314
- a{****************************************************************************}
- c1,18
- a{****************************************************************************}
- c20,29
- aUSES LowMem;
- c29,29
- a{****************************************************************************}
- c31,33
- a{****************************************************************************}
- c35,42
- a{****************************************************************************}
- c44,46
- a{****************************************************************************}
- c48,56
- a { hitPt is expressed in global coordinates, but we need it }
- a { in pane coordinates. Take advantage of the fact that }
- a { SetupQuickDraw sets up the grafport so the origin is the }
- a { top left of the menu pane, and use the Toolbox's }
- a { GlobalToLocal to convert the hitPt to pane coordinates. }
- c56,56
- c63,68
- a { Support the new MenuChoice feature described in IM V-240. }
- a { The low-memory global MenuDisable is updated to reflect }
- a { the current menu and item ID, even if the mouse is over a }
- a { disabled item or menu. The HiWord of MenuDisable contains }
- a { the menu ID and the LoWord the menu item number. }
- c62,62
- a{ MenuDisable^ := BOR(BSL(macMenu^^.menuID, 16), theItem);}
- a LMSetMenuDisable(BOR(BSL(macMenu^^.menuID, 16), theItem));
- c62,62
- c77,78
- a { Choosing item from enabled menu }
- a { Provide visual feedback by }
- a { dynamically hiliting the item }
- c82,85
- a { No item is being chosen. Either }
- a { pointing at empty space or the }
- a { menu is disable. }
- c89,94
- a { Mouse is outside the menu }
- a { Return item number of zero }
- c74,74
- a{ MenuDisable^ := BSL(Longint(macMenu^^.menuID), 16);}
- a LMSetMenuDisable(BSL(Longint(macMenu^^.menuID), 16));
- c99,100
- a { Tear off the menu if we have a }
- a { TearOffMenu object and the }
- a { menu is enabled (not dimmed) }
- c76,76
- c105,110
- e
- fCTearChore.p
- x182182516,282845440
- a{**************************************************}
- c1,11
- a{**************************************************}
- c13,23
- a{**************************************************}
- c25,28
- a{**************************************************}
- c30,36
- a{**************************************************}
- c38,42
- a{**************************************************}
- c44,51
- e
- fCTearOffMenu.p
- x327448192,127105320
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,22
- a{**************************************************}
- c24,27
- a{**************************************************}
- c29,41
- a itsWindow.IWindow(WINDid, TRUE, gDesktop, self);
- c43,51
- a{**************************************************}
- c53,57
- a{**************************************************}
- c59,70
- a{**************************************************}
- c72,76
- a{**************************************************}
- c69,69
- c79,88
- a{**************************************************}
- c90,94
- a{**************************************************}
- c87,87
- c97,102
- a{**************************************************}
- c104,107
- a{**************************************************}
- c96,96
- c110,117
- a theTearChore.ITearChore(self); { chore for moving the tear off }
- c119,124
- a{**************************************************}
- c126,130
- a{**************************************************}
- c116,116
- c133,139
- a{**************************************************}
- c141,145
- a{**************************************************}
- c132,132
- c148,153
- a{**************************************************}
- c155,161
- a{**************************************************}
- c147,147
- c164,169
- a{**************************************************}
- c171,175
- a{**************************************************}
- c163,163
- c178,184
- e
- fFW_Tearoffs.p
- x277250070,367623466
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,17
- a{**************************************************}
- c19,22
- a{**************************************************}
- c24,29
- a { Instance Variables }
- c27,27
- c32,35
- a { Instance Methods }
- c31,31
- c38,48
- a { TCL 1.1: points should not be var parameters }
- c43,43
- c51,63
- a{**************************************************}
- c65,68
- a{**************************************************}
- c62,62
- c71,73
- a { Instance Variables }
- c70,70
- c76,78
- a { Instance Methods }
- c70,70
- c81,103
- a{**************************************************}
- c105,108
- a{**************************************************}
- c102,102
- c111,118
- a { Instance Variables }
- c110,110
- c121,122
- a { Instance Methods }
- c110,110
- c125,136
- a{**************************************************}
- c138,141
- a{**************************************************}
- c130,130
- c144,146
- a { Instance Variables }
- c130,130
- c149,151
- a { Instance Methods }
- c135,135
- c154,171
- a VAR macEvent: EventRecord);
- c156,156
- c174,190
- a{**************************************************}
- c192,195
- a{**************************************************}
- c188,188
- c198,200
- a { No Instance Variables }
- c188,188
- a { Instance Methods }
- c188,188
- c205,220
- a{**************************************************}
- c222,225
- a{**************************************************}
- c202,202
- c228,230
- a { Instance Variables }
- c206,206
- c233,237
- a { Instance Methods }
- c219,219
- c240,259
- a{**************************************************}
- c261,264
- a{**************************************************}
- c237,237
- c267,269
- a { Instance Variables }
- c243,243
- c272,274
- a { Instance Methods }
- c249,249
- c277,296
- a{**************************************************}
- c298,301
- a{**************************************************}
- c269,269
- c304,306
- a { No Instance Variables }
- c274,274
- a { Instance Methods }
- c274,274
- c311,321
- a{**************************************************}
- c323,326
- a{**************************************************}
- c292,292
- c304,304
- c330,331
- a { Instance Variables }
- c295,295
- c334,335
- a { Instance Methods }
- c303,303
- c338,344
- a{**************************************************}
- c346,349
- a{**************************************************}
- c310,310
- c329,329
- c353,354
- a { Instance Variables }
- c314,314
- c357,365
- a { Instance Methods }
- c328,328
- c368,385
- a{**************************************************}
- c387,390
- a{**************************************************}
- c351,352
- c394,410
- a{**************************************************}
- c387,388
- c414,419
- a{**************************************************}
- c377,377
- c377,377
- c403,403
- c424,459
- e
- rWindoid WDEF ƒ
- fWindoidWDEF.p
- x270590446,20201415
- c0,36
- aUSES Windows, ToolUtils;
- c38,38
- a{$MAIN}
- c338,339
- c39,368
- e
- o
- o
- rMore classes
- fCBitMap.p
- x50712761,131702445
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,23
- a{** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S **}
- c22,23
- c25,25
- a{**************************************************}
- c29,32
- a{**************************************************}
- c34,87
- a{**************************************************}
- c89,92
- a{**************************************************}
- c87,87
- c95,97
- a DisposePtr(macBitMap.baseAddr);
- c94,94
- c100,102
- a DisposePtr(Ptr(macPort));
- c104,110
- a{** A C C E S S I N G M E T H O D S **}
- c105,105
- c105,105
- c105,105
- a{**************************************************}
- c116,120
- a{**************************************************}
- c110,110
- c123,124
- a QDToLongRect(macBitMap.bounds, theBounds);
- c126,128
- a{**************************************************}
- c130,134
- a{**************************************************}
- c122,122
- c137,145
- a{**************************************************}
- c147,150
- a{**************************************************}
- c136,136
- c153,158
- a{**************************************************}
- c160,163
- a{**************************************************}
- c152,152
- c166,171
- a{**************************************************}
- c173,178
- a{**************************************************}
- c165,165
- c181,205
- a{** I M A G E C O P Y I N G M E T H O D S **}
- c185,185
- c189,189
- c189,189
- a{**************************************************}
- c211,220
- a{**************************************************}
- c198,198
- c223,228
- a CopyBits(qd.thePort^.portBits, macBitMap, rFrom, rTo, xferMode, maskRgn);
- c230,232
- a{**************************************************}
- c234,243
- a{**************************************************}
- c222,222
- c246,251
- a CopyBits(macBitMap, qd.thePort^.portBits, rFrom, rTo, xferMode, maskRgn);
- c230,232
- c231,231
- a{** P R E P A R I N G M E T H O D S **}
- c231,232
- c231,231
- a{**************************************************}
- c262,269
- a{**************************************************}
- c245,245
- c272,275
- a saveBitMap := qd.thePort^.portBits; { Save current bit map for later }
- c277,288
- a{**************************************************}
- c290,295
- a{**************************************************}
- c271,271
- c298,307
- e
- fCBitMapPane.p
- x415614287,90409867
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,22
- a{** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S **}
- c21,22
- c24,24
- a{**************************************************}
- c28,31
- a{**************************************************}
- c33,67
- a{**************************************************}
- c69,72
- a{**************************************************}
- c67,67
- c75,84
- a{** A C C E S S I N G M E T H O D S **}
- c79,79
- c79,79
- c82,82
- a{**************************************************}
- c90,93
- a{**************************************************}
- c86,86
- c96,101
- a{**************************************************}
- c103,106
- a{**************************************************}
- c100,100
- c109,115
- a{** D R A W I N G M E T H O D S **}
- c108,108
- c108,108
- c108,108
- a{**************************************************}
- c121,124
- a{**************************************************}
- c113,113
- c127,142
- e
- fCPictFile.p
- x91140466,312678590
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,20
- a{* Class Constant *}
- c19,19
- c23,29
- a{**************************************************}
- c31,34
- a{**************************************************}
- c36,44
- a{**************************************************}
- c46,49
- a{**************************************************}
- c44,44
- c52,54
- a DisposeHandle(header);
- c51,51
- c57,60
- a{**************************************************}
- c62,65
- a{**************************************************}
- c59,59
- c68,107
- a{**************************************************}
- c109,113
- a{**************************************************}
- c104,104
- c116,149
- e
- fCPNTGFile.p
- x516302592,473935182
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,22
- a{* Class Constants *}
- c21,21
- c25,32
- a{**************************************************}
- c34,37
- a{**************************************************}
- c39,53
- a{**************************************************}
- c55,58
- a{**************************************************}
- c53,53
- c61,63
- a DisposeHandle(header);
- c60,60
- c66,69
- a{**************************************************}
- c71,75
- a{**************************************************}
- c68,68
- c78,93
- a ForgetObject(theBitMap);
- c95,100
- a theBitMap := nil;
- c90,90
- c103,163
- a DisposePtr(packedBits); { No longer need compressed image }
- c165,169
- a{**************************************************}
- c171,174
- a{**************************************************}
- c163,163
- c177,217
- e
- fCResFile.p
- x179930255,224058045
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,21
- a{** C O N S T R U C T I O N / D E S T R U C T I O N M E T H O D S **}
- c20,21
- c23,23
- a{**************************************************}
- c27,30
- a{**************************************************}
- c32,39
- a{**************************************************}
- c41,45
- a{**************************************************}
- c47,60
- a{**************************************************}
- c62,65
- a{**************************************************}
- c59,59
- c68,78
- a{**************************************************}
- c80,83
- a{**************************************************}
- c77,77
- c86,90
- a{****************************************************************************}
- c92,94
- a{****************************************************************************}
- c85,85
- c97,102
- a{****************************************************************************}
- c104,106
- a{****************************************************************************}
- c93,93
- c109,110
- a Assert(IsOpen);
- c96,96
- c113,119
- a{****************************************************************************}
- c121,123
- a{****************************************************************************}
- c108,108
- c126,136
- a FailOSErr(PBHGetFInfoSync(@pBlock));
- c119,119
- a { Assume that if the resource fork logical EOF is non-zero }
- a { then a resource fork exists. }
- c122,122
- c142,147
- a{****************************************************************************}
- c149,151
- a {****************************************************************************}
- c131,131
- c154,158
- a { only call inherited if file doesn't already exist on disk }
- c136,136
- c161,172
- e
- fCStack.p
- x311221665,445438897
- a{**************************************************}
- c1,11
- a{**************************************************}
- c13,23
- a{**************************************************}
- c25,28
- a{**************************************************}
- c30,36
- a{**************************************************}
- c38,41
- a{**************************************************}
- c43,49
- a{**************************************************}
- c51,55
- a{**************************************************}
- c49,49
- c58,86
- e
- fCTextEnvirons.p
- x394566399,25467027
- a{**************************************************}
- c1,10
- a{**************************************************}
- c12,22
- a{**************************************************}
- c24,27
- a{**************************************************}
- c29,38
- a{**************************************************}
- c40,43
- a{**************************************************}
- c45,55
- a{**************************************************}
- c57,60
- a{**************************************************}
- c54,54
- c63,68
- a{**************************************************}
- c70,73
- a{**************************************************}
- c67,67
- c76,82
- e
- fMoreTCL.p
- x455964128,345181636
- a{**************************************************}
- c1,8
- a{**************************************************}
- c10,19
- a{**************************************************}
- c21,24
- a{**************************************************}
- c26,29
- a { Instance Variables }
- c26,26
- c32,37
- a { Instance Methods }
- c37,37
- c40,64
- a{**************************************************}
- c66,69
- a{**************************************************}
- c63,63
- c72,74
- a { Instance Variables }
- c71,71
- c77,78
- a { Instance Methods }
- c71,71
- c81,97
- a{**************************************************}
- c99,102
- a{**************************************************}
- c93,93
- c105,107
- a { Instance Variables }
- c97,97
- c110,111
- a { Instance Methods }
- c113,123
- a{**************************************************}
- c125,128
- a{**************************************************}
- c116,116
- c131,133
- a { Instance Variables }
- c122,122
- c136,137
- a { Instance Methods }
- c122,122
- c140,152
- a{**************************************************}
- c154,157
- a{**************************************************}
- c139,139
- c160,162
- a { Instance Variables }
- c143,143
- c165,166
- a { Instance Methods }
- c147,147
- c169,182
- a{**************************************************}
- c184,187
- a{**************************************************}
- c166,166
- c190,192
- a { No Instance Variables }
- c170,170
- a { Instance Methods }
- c170,170
- c197,203
- a{**************************************************}
- c205,208
- a{**************************************************}
- c182,182
- c190,190
- c212,219
- a { Instance Variables }
- c192,192
- c222,223
- a { Instance Methods }
- c196,196
- c226,237
- e
- o
- rStyledText classes
- fCStyleTEClipboard.p
- x25705531,261526315
- a{****************************************************************************}
- c1,14
- a{ styleClip.IStyleTEClipboard( self, TRUE);}
- c16,25
- a{****************************************************************************}
- c27,36
- a{****************************************************************************}
- c38,40
- a{****************************************************************************}
- c42,47
- a{****************************************************************************}
- c49,54
- a{****************************************************************************}
- c56,86
- a text.IStyleText(itsScrollPane, self, 1, 1, 0, 0, sizELASTIC, sizELASTIC, 1000);
- c88,96
- a { CStyleText makes its own copy. }
- c98,111
- e
- fCStyleTEEditTask.p
- x94632181,29411907
- a{****************************************************************************}
- c1,15
- a{****************************************************************************}
- c17,26
- a{****************************************************************************}
- c28,37
- a{****************************************************************************}
- c39,56
- a{****************************************************************************}
- c58,64
- a{****************************************************************************}
- c66,88
- a{****************************************************************************}
- c90,93
- a{****************************************************************************}
- c95,131
- a { Due to backspacing, the save styled scrap handle may}
- a { begin with negative offsets. Before attempting to}
- a { restore these styles we must fix up the offsets}
- a { to start at 0.}
- c131,131
- c137,160
- a{****************************************************************************}
- c162,162
- a{****************************************************************************}
- c164,179
- a{****************************************************************************}
- c181,186
- a{****************************************************************************}
- c188,199
- a {)
- c201,206
- a{ }
- c199,199
- c209,212
- a { make up a style scrap element for the char to be deleted. }
- a { Then we'll see if it matches the last style in the }
- a { saved scrap. If not, we need to insert it to the scrap }
- c199,199
- c217,220
- a { remaining fields are equivalent to a TextStyle record }
- c208,208
- c223,225
- a { CheckNewStyle inserts the new style at the head of the }
- a { style scrap if its new. Otherwise, we just decrement }
- a { the starting offset for the first style. This is }
- a { faster than running through the whole table, fixing }
- a { up offsets each time the user backspaces, but we have }
- a { to be sure and fix these up later, before attempting to }
- a { use these styles }
- c208,208
- c234,239
- a{****************************************************************************}
- c241,247
- a{****************************************************************************}
- c249,268
- a { make up a style scrap element for the char to be deleted. }
- c239,239
- c271,276
- a { remaining fields are equivalent to a TextStyle record }
- c260,260
- c279,286
- a{****************************************************************************}
- c288,290
- a{****************************************************************************}
- c292,299
- a{****************************************************************************}
- c301,306
- a{****************************************************************************}
- c308,322
- a { compare scrapEl with either first or last scrapElement in scrap handle }
- a { but don't compare the scrpStartChar fields }
- a { If they don't match, then a new ScrpSTElement is inserted }
- c286,286
- c327,332
- a { if atStart, then move old styles down }
- c299,299
- c335,339
- a { place new style in position, increment count }
- c299,299
- c342,349
- e
- fCStyleTEStyleTask.p
- x206443299,266841547
- a{****************************************************************************}
- c1,11
- a{****************************************************************************}
- c13,22
- a{****************************************************************************}
- c24,29
- a{****************************************************************************}
- c31,43
- a self.selStart := selStart;
- a self.selEnd := selEnd;
- c46,47
- a{****************************************************************************}
- c49,52
- a{****************************************************************************}
- c54,86
- a SaveStyle; { save the current styling }
- c81,81
- c89,92
- a RestoreStyle; { restore the previous styling }
- c86,86
- c95,96
- a oldStyles := newStyles; { swap current and previous }
- c88,88
- c99,113
- a{****************************************************************************}
- c115,117
- a{****************************************************************************}
- c119,120
- a oldStyles := NIL; { GetStyleScrap may fail }
- c109,109
- c123,126
- a{****************************************************************************}
- c128,130
- a{****************************************************************************}
- c132,145
- a{****************************************************************************}
- c147,147
- a{****************************************************************************}
- c149,155
- e
- fCStyleText.p
- x346872148,366216718
- a{****************************************************************************}
- c1,16
- a{****************************************************************************}
- c18,28
- a Script, Fonts;
- c27,27
- c31,32
- a kHScrollStep = 10; { horizontal scroll unit }
- c30,30
- a{****************************************************************************}
- c36,38
- a{****************************************************************************}
- c40,49
- a{****************************************************************************}
- c51,53
- a{****************************************************************************}
- c55,62
- a{****************************************************************************}
- c64,66
- a{****************************************************************************}
- c68,76
- a macTE := TEStyleNew(tFrame, tFrame);
- c78,81
- a{****************************************************************************}
- c83,86
- a{****************************************************************************}
- c88,94
- a{****************************************************************************}
- c96,100
- a{****************************************************************************}
- c102,123
- a TEStylePaste(macTE);
- c112,112
- c126,132
- a{****************************************************************************}
- c134,136
- a{****************************************************************************}
- c138,143
- a TEStyleInsert(text, length, styles, macTE);
- c129,129
- c131,132
- a{****************************************************************************}
- c149,152
- a{****************************************************************************}
- c154,167
- a{****************************************************************************}
- c169,171
- a{****************************************************************************}
- c173,180
- a{****************************************************************************}
- c182,184
- a{****************************************************************************}
- c186,197
- a{****************************************************************************}
- c199,201
- a{****************************************************************************}
- c203,210
- a{****************************************************************************}
- c212,216
- a{****************************************************************************}
- c218,242
- a{****************************************************************************}
- c244,245
- a{****************************************************************************}
- c247,251
- a { only single spacing is supported! }
- c242,242
- c254,258
- a{****************************************************************************}
- c260,262
- a{****************************************************************************}
- c264,281
- a editTask.IStyleTEEditTask(self, editCmd, cFirstTaskIndex);
- c248,248
- c284,287
- a{****************************************************************************}
- c289,292
- a{****************************************************************************}
- c294,308
- a newTask.IStyleTEStyleTask(self, styleCmd, cFirstTaskIndex);
- c284,284
- c274,274
- c312,314
- a{ pre-flight allocating memory for the style scrap }
- a{****************************************************************************}
- c317,322
- a{****************************************************************************}
- c324,331
- a DisposeHandle(Handle(h));
- c298,298
- c298,298
- a h := TEGetStyleScrapHandle(macTE);
- c298,298
- a { shouldn't happen, but checking doesn't hurt }
- c331,331
- c339,342
- a{****************************************************************************}
- c344,347
- a{****************************************************************************}
- c349,353
- a TEUseStyleScrap(rangeStart, rangeEnd, styleScrap, redraw, macTE);
- c355,359
- e
- fTCL_StyledText.p
- x159076374,80241934
- a{****************************************************************************}
- c1,9
- a{****************************************************************************}
- c11,18
- a{****************************************************************************}
- c20,21
- a{****************************************************************************}
- c23,66
- a{****************************************************************************}
- c68,69
- a{****************************************************************************}
- c66,66
- c72,74
- a macTE: TEHandle; { TEHandle of itsTextPane }
- a origStyleScrap: StScrpHandle; { original styles on clipboard }
- a deletedStyles: StScrpHandle; { styles of original text }
- a insertedStyles: StScrpHandle; { styles of inserted text }
- c71,71
- c80,101
- a{****************************************************************************}
- c103,104
- a{****************************************************************************}
- c106,126
- a{****************************************************************************}
- c128,129
- a{****************************************************************************}
- c131,143
- e
- o
- rTable classes
- fCArrayPane.p
- x432516406,446917314
- a{****************************************************************************}
- c1,14
- a{****************************************************************************}
- c16,25
- a{****************************************************************************}
- c27,30
- a{****************************************************************************}
- c32,41
- a { by default, set up the table to have a single column, and to }
- a { draw cells in column major order.}
- c39,39
- c45,48
- a{****************************************************************************}
- c50,52
- a{****************************************************************************}
- c48,48
- c55,67
- a{****************************************************************************}
- c69,71
- a{****************************************************************************}
- c73,79
- a{****************************************************************************}
- c81,85
- a{****************************************************************************}
- c87,91
- a Assert(anArray <> NIL);
- c93,114
- a{****************************************************************************}
- c116,118
- a{****************************************************************************}
- c120,125
- a{****************************************************************************}
- c127,129
- a{****************************************************************************}
- c131,140
- a infoIndex := LongIntPtr(info)^;
- c142,142
- a arrayInsertElement: { new element inserted, add a new row }
- c144,144
- a arrayDeleteElement: { element was deleted, delete its row }
- c146,146
- a arrayMoveElement: { an element was moved, redraw all }
- a { elements encompassing its old and }
- a { new positions }
- c150,157
- a arrayElementChanged: { an element was changed, redraw its }
- a { row }
- c150,150
- c152,153
- c163,174
- a{****************************************************************************}
- c176,180
- a{****************************************************************************}
- c182,191
- e
- fCTable.p
- x338267779,58733727
- a{****************************************************************************}
- c1,14
- a{*****************************************************************************}
- c16,28
- a MoreTCL, QuickDrawText, FOnts;
- c27,27
- c31,32
- a kDefaultHIndent = 3; { default horizontal cell indent }
- a kDefaultColWidth = 50; { default column width }
- c30,30
- a kBorderMargin = 1; { margin of active border}
- a kBorderPen = 2; { pen size of active border}
- c32,32
- c32,32
- a{****************************************************************************}
- c41,43
- a{****************************************************************************}
- c45,50
- a { call superclass's initializer }
- c50,50
- c53,55
- a SetWantsClicks(TRUE); { we want to be clicked! }
- c57,59
- a{****************************************************************************}
- c61,63
- a{****************************************************************************}
- c52,52
- c66,105
- a BlockMoveData(@qd.black, @pat, sizeof(Pattern));
- c95,95
- c108,120
- a BlockMoveData(@qd.black, @pat, sizeof(Pattern));
- c107,107
- c123,126
- a{****************************************************************************}
- c128,130
- a{****************************************************************************}
- c132,134
- a info: FontInfo;
- c136,140
- a { make sure class variables are initialized }
- c142,148
- a { start with no cells }
- c150,151
- a { selection is empty }
- c153,162
- a { default to row major drawing }
- c164,164
- a { don't clip cell drawing to cell rects }
- c166,166
- a { no special flags }
- c168,172
- a { setup the desired text characteristics }
- c174,175
- a { setup the port and restore the text environment }
- c151,151
- c178,178
- a GetFontInfo(info);
- a { set the instance variable }
- a itsFontInfo := info;
- c154,154
- a rowHeight := itsFontInfo.ascent + itsFontInfo.descent + itsFontInfo.leading;
- a { add a pixel extra on the top and bottom of rows, to look nice }
- c185,185
- a SetPt(indent, kDefaultHIndent, itsFontInfo.ascent + 1);
- c158,158
- c188,193
- a SetRowBorders(0, srcCopy, qd.black);
- a SetColBorders(0, srcCopy, qd.black);
- c196,199
- a{****************************************************************************}
- c201,204
- a{****************************************************************************}
- c206,221
- a{****************************************************************************}
- c223,229
- a{****************************************************************************}
- c231,239
- a { if we are embedded in a scroll pane, then use the default row and column }
- a { sizes as the scroll step and overlap }
- c242,249
- a{****************************************************************************}
- c251,255
- a{****************************************************************************}
- c257,265
- a{****************************************************************************}
- c267,277
- a{****************************************************************************}
- c279,285
- a{****************************************************************************}
- c287,292
- a{****************************************************************************}
- c294,298
- a tblTask.ITableDragger(self, modifiers, selectionFlags);
- c300,303
- a{****************************************************************************}
- c305,311
- a{****************************************************************************}
- c313,324
- a IF (gClicks = 2) THEN { a double click? }
- c326,330
- a ELSE { a single click, make mouse task and pass to TrackMouse }
- c283,283
- c326,326
- c334,348
- a{****************************************************************************}
- c350,352
- a{****************************************************************************}
- c354,359
- a{****************************************************************************}
- c361,367
- a{****************************************************************************}
- c369,378
- a{****************************************************************************}
- c380,386
- a{****************************************************************************}
- c388,394
- a { points are in window coords, convert to local coords }
- c396,398
- a { find the cell hit by each point }
- c346,346
- c401,403
- a { before we test the cells for equality, we must make sure that that }
- a { both points were in the table in the first place. }
- c346,346
- c407,413
- a{****************************************************************************}
- c415,419
- a{****************************************************************************}
- c421,427
- a { clip afterRows to actual row count, remember row numbers zero-based }
- c372,372
- c430,432
- a { get the height for the new row. Normally use the height of }
- a { afterRow, if it exists. If we are inserting before row 0 }
- a { use that, otherwise use the default value }
- c372,372
- c437,455
- a{****************************************************************************}
- c457,460
- a{****************************************************************************}
- c462,468
- a { clip afterCols to actual colCount, remember col numbers zero-based }
- c470,472
- a { get the width for the new column. Normally use the width of }
- a { afterCol, if it exists. If we are inserting before column 0 }
- a { use that, otherwise use the default value }
- c403,403
- c477,495
- a{****************************************************************************}
- c497,502
- a{****************************************************************************}
- c504,510
- a { clip startRow and numRows to actual #rows }
- c436,436
- c513,516
- a { ensure that cells being deleted are not selected }
- c518,519
- a startRow := startRow + 1; { shift to one-based index }
- c453,453
- c522,533
- a{****************************************************************************}
- c535,540
- a{****************************************************************************}
- c542,549
- a { clip startCol and numCols to actual #cols }
- c472,472
- c552,555
- a { ensure that cells being deleted are not selected }
- c476,476
- c518,519
- a startCol := startCol + 1; { shift to one-based index }
- c493,493
- c562,573
- a{****************************************************************************}
- c575,577
- a{****************************************************************************}
- c579,591
- a{****************************************************************************}
- c593,595
- a{****************************************************************************}
- c597,610
- a{****************************************************************************}
- c612,614
- a{****************************************************************************}
- c616,621
- a{****************************************************************************}
- c623,625
- a{****************************************************************************}
- c627,632
- a{****************************************************************************}
- c634,636
- a{****************************************************************************}
- c638,643
- a{****************************************************************************}
- c645,647
- a{****************************************************************************}
- c649,657
- a{****************************************************************************}
- c659,661
- a{****************************************************************************}
- c663,671
- a{****************************************************************************}
- c673,676
- a{****************************************************************************}
- c678,681
- a Assert((rowNum >= 0) & (rowNum < tableBounds.bottom));
- c589,589
- a { itsRows contains the heights of all rows. Need to total the heights }
- a { to figure where a row starts. SumRange totals up to and including }
- a { the end index, so do not add 1 and therefore find out where the }
- a { previous row ends }
- c589,589
- c689,697
- a{****************************************************************************}
- c699,702
- a{****************************************************************************}
- c704,707
- a Assert((colNum >= 0) & (colNum < tableBounds.right));
- c709,716
- a{****************************************************************************}
- c718,722
- a{****************************************************************************}
- c724,732
- a { top left of pixelR may be greater than 0,0 because of topLeftIndent }
- c630,630
- c735,740
- a{ make a default string which is row,col }
- a{****************************************************************************}
- c743,745
- a{****************************************************************************}
- c747,759
- a{****************************************************************************}
- c761,764
- a{****************************************************************************}
- c766,780
- a { account for topLeftIndent }
- c669,669
- c783,788
- a { find bounding cells of redraw rect }
- c683,683
- c791,799
- a { if the selection is rectangular, we can optimize by }
- a { hiliting cells in one fell swoop. Otherwise we }
- a { resort to hiliting one cell at a time. }
- c683,683
- a reallyActive := self.IsActive;
- c805,833
- a{****************************************************************************}
- c835,839
- a{****************************************************************************}
- c841,878
- a{****************************************************************************}
- c880,884
- a{****************************************************************************}
- c886,922
- a{****************************************************************************}
- c924,930
- a{****************************************************************************}
- c932,947
- a{****************************************************************************}
- c949,953
- a{****************************************************************************}
- c955,963
- a { get the pixels spanning the cells }
- c844,844
- c966,968
- a { invert with user's hilite color }
- c970,976
- a{****************************************************************************}
- c978,981
- a{****************************************************************************}
- c983,996
- a { borders are drawn on the tops of rows and left of columns }
- a { but we don't want to border row or column zero }
- c865,865
- c1000,1004
- a { draw column borders }
- c876,876
- c1007,1022
- a { draw row borders }
- c899,899
- c1025,1043
- a{****************************************************************************}
- c1045,1048
- a{****************************************************************************}
- c1050,1061
- a{****************************************************************************}
- c1063,1065
- a{****************************************************************************}
- c1067,1079
- a{****************************************************************************}
- c1081,1083
- a{****************************************************************************}
- c1085,1088
- a { Check if theCell is in table bounds. Note that this }
- a { also handles case of empty table }
- c947,947
- c1092,1103
- a{****************************************************************************}
- c1105,1107
- a{****************************************************************************}
- c1109,1126
- a{****************************************************************************}
- c1128,1130
- a{****************************************************************************}
- c1132,1149
- a{****************************************************************************}
- c1151,1155
- a{****************************************************************************}
- c1157,1175
- a{****************************************************************************}
- c1177,1182
- a{****************************************************************************}
- c1184,1207
- a{****************************************************************************}
- c1209,1213
- a{****************************************************************************}
- c1215,1222
- a{****************************************************************************}
- c1224,1227
- a{****************************************************************************}
- c1229,1236
- a{****************************************************************************}
- c1238,1240
- a{****************************************************************************}
- c1242,1252
- a{****************************************************************************}
- c1254,1259
- a{****************************************************************************}
- c1261,1273
- a { first clip selRect to intersection with tableBounds }
- c1122,1122
- c1122,1122
- c1277,1279
- a { cNewSelection holds the cells to be selected }
- c1122,1122
- c1282,1283
- a { Only clear the old selection if it has been requested }
- a { and is non-empty }
- c1122,1122
- c1287,1289
- a { Determine the region of cells that will be newly selected }
- a { not simply deselected and reselected }
- c1126,1126
- c1293,1294
- a { deselect the deselection }
- c1145,1145
- c1297,1302
- a { determine the cells that will actually be deselected }
- c1145,1145
- c1305,1306
- a { Before updating itsSelection, copy it so we know what cells }
- a { are currently hilited (if redrawing otherwise we don't care) }
- c1145,1145
- c1310,1311
- a { union the old selection with the new selection }
- c1145,1145
- c1314,1318
- a { attempt to make cDeselection and cNewSelection rectangular }
- a { so we can hilite them efficiently }
- c1147,1147
- c1322,1326
- a { Try unioning cDeselection and itsSelection. To }
- a { compensate, we would have to then union itsSelection }
- a { with cNewSelection. If cNewSelection is already }
- a { rectangular, we don't even attempt it, because we }
- a { may be optimizing deselection while simultaneously }
- a { screwing up selection }
- c1173,1173
- c1334,1339
- a { cCurrHilite was rectangular. Now that we have unioned }
- a { it with cNewSelection, we must either unhilite }
- a { cCurrHilite before hiliting cNewSelection, or even }
- a { better, simply clip it out. }
- c1173,1173
- c1345,1361
- a DiffRgn(qd.thePort^.clipRgn, gUtilRgn, qd.thePort^.clipRgn);
- c1363,1373
- a BEGIN { just invalidate }
- c1205,1205
- c1376,1389
- a{****************************************************************************}
- c1391,1396
- a{****************************************************************************}
- c1398,1427
- a{****************************************************************************}
- c1429,1431
- a{****************************************************************************}
- c1433,1441
- a { DeselectRect will validate the input, no reason to do it twice }
- c1252,1252
- c1444,1447
- a{****************************************************************************}
- c1449,1451
- a{****************************************************************************}
- c1453,1462
- a { first clip selectRect to intersection with tableBounds }
- c1273,1273
- c1465,1468
- a { only deselect cells that were actually selected }
- c1275,1275
- c1471,1479
- a { we need to unhilite a rectangular area, }
- a { don't necessarily need to redraw }
- c1482,1502
- a{****************************************************************************}
- c1504,1507
- a{****************************************************************************}
- c1509,1517
- a{****************************************************************************}
- c1519,1524
- a{****************************************************************************}
- c1526,1532
- a{****************************************************************************}
- c1534,1536
- a{****************************************************************************}
- c1538,1544
- a{****************************************************************************}
- c1546,1558
- a{****************************************************************************}
- c1560,1584
- a BEGIN { no more cells }
- c1586,1589
- a BEGIN { don't want next row }
- c1586,1587
- c1593,1596
- a newCell.h := 0; { beginning of next row }
- a newCell.v := newCell.v + 1; { we know its not the last row }
- c1425,1425
- c1422,1422
- c1425,1425
- c1602,1603
- a ELSE { next cell in row }
- c1605,1607
- a ELSE IF (vNext) THEN { hNext was false }
- c1405,1405
- c1610,1610
- a BEGIN { no more rows }
- c1612,1616
- a newCell.v := newCell.v + 1; { next cell in column }
- c1424,1424
- c1619,1624
- a{****************************************************************************}
- c1626,1634
- a{****************************************************************************}
- c1636,1676
- a{****************************************************************************}
- c1678,1681
- a{****************************************************************************}
- c1683,1693
- a IF (EmptyRect(selRect) | EmptyLongRect(aperture)) THEN { nothing selected or nothing visible}
- c1695,1696
- a { bottom right actual cell of rect }
- c1500,1500
- c1699,1702
- a selPos := position; { init to current scroll position }
- c1500,1500
- a { get pixels of topLeft and botRight cells of the selection }
- c1500,1500
- c1707,1709
- a { Note that the we always ensure that the full top left or }
- a { bottom right cell is in view. For example, if there is 1 selected }
- a { cell, located in the top left of the frame such that only }
- a { the rightmost edge of the cell is visible, we will scroll }
- a { the cell completely into view. }
- c1500,1500
- a {*** calc vertical scroll ***}
- c1500,1500
- a { Is the top of selection below the bottom of frame? }
- c1500,1500
- c1500,1500
- c1721,1725
- a { Is the bottom of selection above the top of the frame? }
- c1500,1500
- c1728,1732
- a {*** calc horizontal scroll ***}
- c1515,1515
- a { Is the left edge of selection past the right edge of frame? }
- c1515,1515
- c1737,1741
- a { Is the right edge of selection before the left edge of frame? }
- c1515,1515
- c1744,1752
- a{****************************************************************************}
- c1754,1756
- a{****************************************************************************}
- c1758,1763
- a{****************************************************************************}
- c1765,1767
- a{****************************************************************************}
- c1769,1773
- a{****************************************************************************}
- c1775,1779
- a{****************************************************************************}
- c1781,1782
- a VAR macEvent: EventRecord);
- c1562,1562
- c1785,1809
- a { if no selection, put selection at 0,0 }
- c1574,1574
- c1645,1645
- c1813,1815
- a { OK, its a rect, check for }
- a { single selected cell }
- c1818,1830
- a { moving to a real cell? }
- c1594,1594
- c1833,1840
- a{****************************************************************************}
- c1842,1844
- a{****************************************************************************}
- c1846,1847
- a VAR macEvent: EventRecord);
- c1644,1644
- c1850,1853
- a{****************************************************************************}
- c1855,1857
- a{****************************************************************************}
- c1859,1874
- a{****************************************************************************}
- c1876,1878
- a{****************************************************************************}
- c1880,1887
- a{****************************************************************************}
- c1889,1892
- a{****************************************************************************}
- c1894,1903
- a{****************************************************************************}
- c1905,1908
- a{****************************************************************************}
- c1910,1919
- a{****************************************************************************}
- c1921,1923
- a{****************************************************************************}
- c1925,1930
- a{****************************************************************************}
- c1932,1940
- a{****************************************************************************}
- c1942,1973
- a{****************************************************************************}
- c1975,1976
- a{****************************************************************************}
- c1719,1719
- c1979,1983
- a HiliteCellRegion(itsSelection, TRUE);
- c1731,1732
- c1987,1989
- a{****************************************************************************}
- c1991,1992
- a{****************************************************************************}
- c1732,1732
- c1995,1999
- a HiliteCellRegion(itsSelection, FALSE);
- c1747,1747
- c1741,1741
- c2003,2006
- a{****************************************************************************}
- c2008,2010
- a{****************************************************************************}
- c2012,2022
- a {***** calc vertical strips *****}
- c1761,1761
- c2025,2028
- a { find the column at right end of strip }
- c1763,1763
- c2031,2035
- a { if column fits completely, break the strip after }
- a { the column, otherwise break it before the colum }
- c1773,1773
- c2039,2050
- a {***** calc horizontal strips *****}
- c1792,1792
- c2025,2028
- a { find the row at bottom end of strip }
- c1792,1792
- c2059,2075
- a{****************************************************************************}
- c2077,2079
- a{****************************************************************************}
- c2081,2098
- e
- fCTableDragger.p
- x58113765,441452509
- a{****************************************************************************}
- c1,14
- a{****************************************************************************}
- c16,24
- a{****************************************************************************}
- c26,33
- a{****************************************************************************}
- c35,44
- a { fUseSense determines whether a cell is selected or deselected}
- a { as the mouse moves over it. Normally it is always selected,}
- a { but if the command key is down, we use the state of the first}
- a { cell and apply it to subsequent cells. Works like fatbits.}
- c44,44
- c50,51
- a { fSelectsRects determines whether dragging selects individual}
- a { cells or drags out rectangles. fSelectFlags is set TRUE if}
- a { fUseSense is FALSE, the selOnlyOne selection flag is off,}
- a { and either the selDragRects flag is on or the shift key}
- a { was help down.}
- c44,44
- c58,59
- a { fExtend determines whether new selections are added to }
- a { or replace the previous selection. They are added if fExtend}
- a { is TRUE. It is set TRUE if the selOnlyOne flag is off, and either}
- a { fUseSense is TRUE, fSelectsRects is TRUE and the shift key is down,}
- a { or the selExtendDrag flag is on.}
- c49,49
- c66,69
- a{****************************************************************************}
- c71,74
- a{****************************************************************************}
- c57,57
- c77,78
- a IF itsTable.itsLastTask = self THEN
- c80,84
- a{****************************************************************************}
- c86,89
- a{****************************************************************************}
- c91,113
- a{****************************************************************************}
- c115,121
- a{****************************************************************************}
- c123,132
- a { if no disjoint selections are allowed, then the first }
- a { click always deselects everything }
- c113,113
- c136,137
- a { If fSelectsRects is true soley because selDragsRects is }
- a { true but the shift key wasn't down, then we should not }
- a { select a rectangle initially }
- c113,113
- c142,162
- a{****************************************************************************}
- c164,167
- a{****************************************************************************}
- c169,203
- e
- fTCL_Tables.p
- x413479659,226034495
- c0,0
- a{****************************************************************************}
- c2,10
- a{****************************************************************************}
- c12,17
- a TCL, Lists;
- c16,16
- c19,19
- a{****************************************************************************}
- c22,23
- a{****************************************************************************}
- c20,20
- c26,27
- a { CTable can draw in row major or column major order }
- c25,25
- a tTblDrawOrder = (tblRow, tblCol);
- c25,25
- c32,40
- a tableBounds: Rect; { defines table size in cells }
- a topLeftIndent: Point; { top and left indent of entire table }
- a itsSelection: RgnHandle; { maintains the selection }
- a itsRows: CRunArray; { runs of row heights }
- a itsCols: CRunArray; { runs of column widths }
- a drawOrder: tTblDrawOrder; { defines CTable draws in row or column order }
- a defRowHeight: Integer; { default size of new rows and cols }
- c48,48
- a selectionFlags: Longint; { flags for selection behavior }
- a itsFontInfo: FontInfo; { for text tables }
- a indent: Point; { used by subclasses for cell drawing }
- a dblClickCmd: Longint; { command sent for cell double click }
- c53,72
- a { change size }
- c58,58
- c75,81
- a { query }
- c72,72
- c84,106
- a { clicks }
- c106,106
- c109,140
- a { typing }
- c122,122
- c143,144
- a VAR macEvent: EventRecord);
- c124,124
- c147,148
- a VAR macEvent: EventRecord);
- c134,135
- a { commands }
- c135,135
- c154,160
- a { selecting }
- c140,140
- c163,176
- a { disposal }
- c151,151
- c179,189
- a { Drawing }
- c176,176
- c192,207
- a { text tables only }
- c181,181
- c210,233
- aVAR { class variables used to calc cell selections }
- c207,207
- c236,239
- a { selection flags }
- c214,214
- a selOnlyOne = 1; { only one cell can be selected at a time }
- a selNoDisjoint = 2; { no disjoint selections allowed }
- a selExtendDrag = 4; { extend selections by selecting hit cells }
- a { not by extending rectangles }
- a selDragRects = 8; { dragging always selects rectangles }
- c214,214
- a { synonyms for some Boolean parameters}
- c214,214
- c250,255
- a { Change protocol for CTable - info parameter is NIL }
- c231,231
- c258,262
- a { utility to set a cell }
- c231,231
- c265,268
- a{****************************************************************************}
- c270,271
- a{****************************************************************************}
- c233,233
- c274,276
- a itsTable: CTable; { client table}
- a anchorCell: Cell; { initially clicked cell}
- a prevCell: Cell; { last hit Cell }
- a selectionFlags: Longint; { local copy of table's flags }
- a modifierKeys: Integer; { modifier keys from the mousedown event}
- a fExtend: Boolean; { TRUE if selections are extended}
- a fSelectRects: Boolean; { TRUE if dragging always selects rects}
- a fUseSense: Boolean; { TRUE if use sense of first cell, like fatbits}
- a fFirstWasSelected: Boolean; { TRUE if first cell was selected}
- c237,237
- c287,299
- a{****************************************************************************}
- c301,302
- a{****************************************************************************}
- c252,252
- c255,255
- c274,274
- c307,308
- a itsArray: CArray; { array being displayed }
- a ownsArray: Boolean; { TRUE if Free should dispose of itsArray }
- c257,257
- c312,344
- e
- o
- rTCL 1.1 Doc
- dOOP page 313
- fREAD ME
- x279914242,231837266
- c0,2
- aJuly 23, 1991
- c4,14
- c18,76
- c81,99
- e
- fUsing Dialogs
- i
- fUsing Pop-up Menus
- i
- fUsing Tables
- i
- z4454,READ ME 1.1.2
- “READ ME” for the THINK Class Library
- ===================================
- Copyright © 1991 Symantec Corporation. All rights reserved.
- October 2, 1991
- Font: Geneva 12
-
- INTRODUCTION
- ==============
- This document describes some changes to and features of the THINK Class
- Library that weren’t included in the the “Object-Oriented Programming”
- The first section, “Extra Classes,” tells you where to find out about some
- classes that aren’t described in the manual. The second section, “Last
- Minute Changes,” describes some changes to the THINK Class Library that
- were made after the manual went to press.
-
- Your THINK C package includes the THINK Class Library 1.1.1. This is a
- minor update to the THINK Class Library 1.1 that fixes some bugs.
-
- EXTRA CLASSES
- ===============
- The THINK Class Library 1.1 has three groups of classes that aren’t in
- the “Object-Oriented Programming” manual. Files in the “TCL 1.1 doc”
- folder describe how to use them:
-
- • Dialogs — These classes add support for modal and modeless
- dialogs. You can also use these classes to create document
- windows that look like forms. They’re described in the document
- “Using Dialogs.”
- • Tables — These classes let you display data in a scrolling list
- or a table, like a spreadsheet. They’re described in the
- document “Using Tables.”
- • Pop-up Menus — These classes implement pop-up menus that
- follow Apple’s latest guidelines. They’re described in the
- document “Using Pop-up Menus.”
-
- LAST MINUTE CHANGES
- =====================
- Here are some last-minute changes that aren’t it into the “Object-
- Oriented Programming” manual. They are split into three sections:
- • Both THINK C and Pascal
- • THINK C
- • THINK Pascal.
-
- Both THINK C and Pascal
- ----------------------
- • The following classes override some methods that are not documented
- in the Object-Oriented Programming Manual:
- CControl - RefreshLongRect
- CDirector - RemoveDirector
- CCluster - Copy
- CRunArray - Copy
- CTextStyleTask - Dispose
- See the implementations of these methods for more information.
-
- • CPane has an additional instance variable, itsLastTask. See the
- declaration of CPane for more information.
-
- • If you hook ExitToShell or use the _atexit function in THINK C, you must
- do so before you send your application the IApplication message. If you
- don’t, your function will not execute on exit.
-
- • CControl and CScrollBar respect the visible flag in the CNTL resource.
- Make sure you set the flag appropriately in your resource files, especially
- for the CNTL resource. In the THINK Class Library 1.0, its visible flag
- was set to FALSE.
-
- • When you update an application from the THINK Class Library 1.0 to 1.1,
- make sure you copy all the new resources from the “TCL Resources”
- file.
-
- • If you’re running under System 7.0 and use the CFWDesktop class,
- you cannot step through Standard File dialog filters. Your application
- may crash. You can use Standard File dialog filters, but do not try to step
- through them.
-
- THINK C
- --------
- • Page 313 of the Object-Oriented Programming manual is a misprint. It’s
- a duplicate of page 321. A copy of the correct page 313 is in the same
- folder as this file.
-
- • The macro __cn defined in oops.h returns the name of the class an object
- belongs to. It’s particularly useful in the THINK C debugger.
-
- THINK Pascal
- ------------
- • The “TCL Resources” file and the resource files for all the demos
- contain a SIZE -1 resource. This resource contains the information
- needed to run an application under MultiFinder or System 7.0. Without
- this resource, applications won’t receive AppleEvents under System 7.0.
-
- • When you launch an application under System 7.0, the System sends the
- application an 'oapp' AppleEvent, and the application usually responds by
- opening a blank document. However, when you run an application under
- THINK Pascal, the application doesn’t receive that event. The THINK Class
- Library tries to simulate this event. If the compiler variable TCL_DEBUG
- is TRUE, the THINK Class Library sends your application a DoCommand
- message with the command cmdNew. TCL_DEBUG is set to TRUE in all the
- demo projects that aren’t used for building applications (that is, all demo
- projects that do NOT end in .Build.π).o
- rTCL Libs
- fEqualMem.c
- i
- fExceptions.c
- i
- fExceptions.h
- i
- fLoadSeg_Patch.c
- i
- fLongQD.p
- x85569859,236596683
- a{****************************************************************************}
- c1,18
- a{****************************************************************************}
- c20,72
- a Assert(cPreparedView <> NIL);
- a Assert(member(cPreparedView, CPane));
- c75,80
- a Assert(cPreparedView <> NIL);
- a Assert(member(cPreparedView, CPane));
- c83,266
- e
- z166,cw_EqualMem.c
- #include <string.h>
-
- pascal Boolean EqualMem( void *p1, void *p2, long n);
- pascal Boolean EqualMem( void *p1, void *p2, long n)
- {
- return memcmp(p1,p2,n) == 0;
- }z7438,cw_exceptions.c
- enum // for handlerType field of FailInfo
- {
- kCatchException,
- kTry,
- kCatchFailure
- };
-
- typedef pascal void (*HandlerFuncPtr)(short err, long msg);
-
- #if defined(__POWERPC__)
-
- typedef struct {
- long cr; // == condition register
- long lr; // == link register
- long sp; // == stack pointer
- long regs[19]; // == 19 longs
- double fp14; // saved FP14-FP31
- double fp15;
- double fp16;
- double fp17;
- double fp18;
- double fp19;
- double fp20;
- double fp21;
- double fp22;
- double fp23;
- double fp24;
- double fp25;
- double fp26;
- double fp27;
- double fp28;
- double fp29;
- double fp30;
- double fp31;
- double fpscr; // saved FPSCR
- } thisjmp_buf;
-
- #elif defined(__MC68K__)
-
- typedef struct {
- long regs[13];
- } thisjmp_buf;
-
- #else
- #error
- #endif
-
- typedef struct FailInfo {
- long A6Link;
- char handlerType;
- char fPropagate;
- short pad; // force word alignment for regs.
- HandlerFuncPtr handlerProc;
- struct FailInfo *next;
- thisjmp_buf regs;
- } FailInfo;
-
- pascal char gDefaultPropagation = TRUE;
-
- extern pascal short gLastError; /* last error code that caused a failure */
- extern pascal long gLastMessage; /* last message associated with a failure */
-
- extern pascal void Failure(short e, long m);
-
- extern pascal FailInfo *gTopHandler;
-
- pascal void ThrowHandler(FailInfo *fi);
- pascal void NoHandler(void);
- pascal short CatchException(FailInfo *fi);
-
- #if __MC68K__
- extern pascal void MyFailure(short e, long m, HandlerFuncPtr proc, long A6);
- pascal void CatchFailures(FailInfo *fi, HandlerFuncPtr Handler, long A6);
-
- asm pascal void ThrowHandler(FailInfo *fi)
- {
- addq #4,a7
- move.l (a7)+,a0
- bne cont
- jsr NoHandler // No handler
-
- cont: clr d0
- move.b struct(FailInfo.handlerType)(a0),d0
- add d0,d0
- add dtable(d0),d0
- jmp dtable(d0)
-
- dtable: dc.w catchex
- dc.w try
- dc.w catchfail
-
- catchex:
- movem.l struct(FailInfo.regs)(a0),d3-d7/a1-a4/a6-a7
- move gLastError, (sp)
- jmp (a1)
-
- try:
- movem.l struct(FailInfo.regs)(a0),d3-d7/a1-a4/a6-a7
- move gLastError, d0
- ext.l d0
- jmp (a1)
-
- catchfail:
- movem.l struct(FailInfo.regs)(a0),d3-d7/a1-a4/a6-a7
-
- tst.w gLastError
- beq end
-
- move.w gLastError, -(sp)
- move.l gLastMessage, -(sp)
- move.l struct(FailInfo.handlerProc)(a0), -(sp)
- move.l struct(FailInfo.A6Link)(a0), -(sp)
- jsr MyFailure // defined failure handler
-
- move.w gLastError, -(sp)
- move.l gLastMessage, -(sp)
- jsr Failure // cascade down the chain
-
- end: jmp (a1) // last error
-
- rts // never comes here
- }
-
- asm pascal short CatchException(FailInfo *fi)
- {
- movea.l (a7)+,a1
- movea.l (a7)+,a0
- movem.l d3-d7/a1-a4/a6/a7,struct(FailInfo.regs)(a0)
- clr.l struct(FailInfo.A6Link)(a0)
- clr.l struct(FailInfo.handlerProc)(a0)
- move.b #1,struct(FailInfo.fPropagate)(a0)
- clr.b struct(FailInfo.handlerType)(a0)
- move.l gTopHandler,struct(FailInfo.next)(a0)
- move.l a0,gTopHandler
- clr.w (a7)
- jmp (a1)
- }
-
- asm pascal void CatchFailures(FailInfo *fi, HandlerFuncPtr Handler, long A6)
- {
- movea.l (a7)+,a1 // return address, used in last resort by handler
- move.l (a7)+,d0
- move.l (a7)+,d1
- movea.l (a7)+,a0
- movem.l d3-d7/a1-a4/a6/a7,struct(FailInfo.regs)(a0)
- move.l d0,struct(FailInfo.A6Link)(a0)
- move.l d1,struct(FailInfo.handlerProc)(a0)
- move.b #1,struct(FailInfo.fPropagate)(a0)
- move.b #2,struct(FailInfo.handlerType)(a0)
- move.l gTopHandler,struct(FailInfo.next)(a0)
- move.l a0,gTopHandler
- jmp (a1)
- }
-
- #else
-
- extern pascal void MyFailure(short e, long m, HandlerFuncPtr proc);
- pascal void CatchFailures(FailInfo *fi, HandlerFuncPtr Handler);
-
- asm pascal void ThrowHandler(register FailInfo *fi)
- {
-
- cmplwi r3,0 // if (fi == 0L) NoHandler();
- bne cont
- bl NoHandler
-
- cont:
- lwz r4,gLastError(RTOC) // load gLastError's TOC pointer
-
- // Restoration is the same for all kinds.
-
- lwz r5, fi->regs.cr // restore CR
- lwz r0, fi->regs.lr // restore LR
- lwz sp, fi->regs.sp // restore SP
- lmw r13, fi->regs.regs // restore GP regs
- mtcrf 255, r5
- mtctr r0
- lfd fp14,fi->regs.fp14 // restore FP regs
- lfd fp15,fi->regs.fp15
- lfd fp16,fi->regs.fp16
- lfd fp17,fi->regs.fp17
- lfd fp18,fi->regs.fp18
- lfd fp19,fi->regs.fp19
- lfd fp20,fi->regs.fp20
- lfd fp21,fi->regs.fp21
- lfd fp22,fi->regs.fp22
- lfd fp23,fi->regs.fp23
- lfd fp24,fi->regs.fp24
- lfd fp25,fi->regs.fp25
- lfd fp26,fi->regs.fp26
- lfd fp27,fi->regs.fp27
- lfd fp28,fi->regs.fp28
- lfd fp29,fi->regs.fp29
- lfd fp30,fi->regs.fp30
- lfd fp0, fi->regs.fpscr
- lfd fp31,fi->regs.fp31
- mtfsf 255,fp0
-
-
- lbz r5,fi->handlerType // which kind ?
- extsb r5,r5
- cmpwi r5,2
- beq catchfail
-
- // try and catchexceptions are handled the same way on PPC.
- lhz r3,0(r4)
- beqctr
-
- catchfail:
-
- lhz r6,0(r4) // test gLastError
- cmpwi r6,0
- beqctr
-
- lwz r5,gLastMessage(RTOC)
- lwz r3,fi->handlerProc
-
- lwz r4,0(r5) // gLastMessage
- mr r5,r3 // handler's TVec
- mr r3,r6 // gLastError
-
- bl MyFailure
-
- lwz r3,gLastError(RTOC)
- lwz r5,gLastMessage(RTOC)
- lhz r3,0(r3)
- lwz r4,0(r5)
- bl Failure
- }
-
- asm pascal short CatchException(register FailInfo *fi)
- {
- mfcr r5
- mflr r6
- stw sp, fi->regs.sp // save SP
- stw r5, fi->regs.cr // save CR
- stw r6, fi->regs.lr // save LR
- stmw r13, fi->regs.regs // save GP regs
- mffs fp0
- stfd fp14,fi->regs.fp14 // save FP regs
- stfd fp14,fi->regs.fp14 // save FP14-FP31
- stfd fp15,fi->regs.fp15
- stfd fp16,fi->regs.fp16
- stfd fp17,fi->regs.fp17
- stfd fp18,fi->regs.fp18
- stfd fp19,fi->regs.fp19
- stfd fp20,fi->regs.fp20
- stfd fp21,fi->regs.fp21
- stfd fp22,fi->regs.fp22
- stfd fp23,fi->regs.fp23
- stfd fp24,fi->regs.fp24
- stfd fp25,fi->regs.fp25
- stfd fp26,fi->regs.fp26
- stfd fp27,fi->regs.fp27
- stfd fp28,fi->regs.fp28
- stfd fp29,fi->regs.fp29
- stfd fp30,fi->regs.fp30
- stfd fp31,fi->regs.fp31
- stfd fp0, fi->regs.fpscr // save FPSCR
-
- li r7,0
- lwz r4,gTopHandler(RTOC)
- lwz r5,gDefaultPropagation(RTOC)
- stw r7,fi->A6Link // fi->A6Link = 0;
- stw r7,fi->handlerProc // fi->handlerProc = 0L;
- lbz r5,0(r5)
- stb r7,fi->handlerType // fi->handlerType = kCatchFailure;
- stb r5,fi->fPropagate // fi->fPropagate = gDefaultPropagation;
- stw r4,fi->next // fi->next = gTopHandler;
- stw r3,0(r4) // gTopHandler = fi;
-
- li r3,0
- blr
- }
-
- asm pascal void CatchFailures(register FailInfo *fi, HandlerFuncPtr Handler)
- {
- mfcr r5
- mflr r6
- stw sp, fi->regs.sp // save SP
- stw r5, fi->regs.cr // save CR
- stw r6, fi->regs.lr // save LR
- stmw r13, fi->regs.regs // save GP regs
- mffs fp0
- stfd fp14,fi->regs.fp14 // save FP regs
- stfd fp15,fi->regs.fp15
- stfd fp16,fi->regs.fp16
- stfd fp17,fi->regs.fp17
- stfd fp18,fi->regs.fp18
- stfd fp19,fi->regs.fp19
- stfd fp20,fi->regs.fp20
- stfd fp21,fi->regs.fp21
- stfd fp22,fi->regs.fp22
- stfd fp23,fi->regs.fp23
- stfd fp24,fi->regs.fp24
- stfd fp25,fi->regs.fp25
- stfd fp26,fi->regs.fp26
- stfd fp27,fi->regs.fp27
- stfd fp28,fi->regs.fp28
- stfd fp29,fi->regs.fp29
- stfd fp30,fi->regs.fp30
- stfd fp31,fi->regs.fp31
- stfd fp0, fi->regs.fpscr // save FPSCR
-
- li r7,0
- stw r4,fi->handlerProc // fi->handlerProc = Handler;
- li r8,1
- lwz r4,gTopHandler(RTOC)
- stw r7,fi->A6Link // fi->A6Link = 0;
- li r9,2
- stb r8,fi->fPropagate // fi->fPropagate = true;
- lwz r5,0(r4)
- stb r9,fi->handlerType // fi->handlerType = kCatchFailure;
- stw r5,fi->next // fi->next = gTopHandler;
- stw r3,0(r4) // gTopHandler = fi;
-
- blr
- }
- #endif
- z509,cw_gluePPC.c
- #include <MixedMode.h>
-
- pascal void BuildRoutineDescriptor(
- RoutineDescriptorPtr aDescriptor,
- ProcInfoType procInfo,
- ProcPtr theProc);
-
- pascal void BuildRoutineDescriptor(
- RoutineDescriptorPtr aDescriptor,
- ProcInfoType procInfo,
- ProcPtr theProc)
- {
- RoutineDescriptor tempDescriptor = BUILD_ROUTINE_DESCRIPTOR(0,NULL);
-
- tempDescriptor.routineRecords[0].procInfo = procInfo;
- tempDescriptor.routineRecords[0].procDescriptor = theProc;
- *aDescriptor = tempDescriptor;
- }
- z9730,MethTableUtils.p
- unit MethTableUtils;
-
- interface
-
- uses
- TCL;
- { Initialize this unit: order the method tables. }
- procedure InitMethTableUtils;
-
- { Given a class name, instantiate an object of that class. Return NIL if unknown class name or failed allocation }
- function NewByName (className: Str255): LongInt;
- { Creates an object of the given class name }
-
- function ClassName (obj: univ LongInt): Str255;
-
- implementation
-
- {--------------------------------------------------------------------------------------------------}
-
- const
- NoClass = 0;
-
- type
- {$IFC MWERKS}
- ClassID = Longint;
- SuperClassTableSize = ClassID; { in 32 B-E is a longint else int}
- SuperClassTable = RECORD
- itsSize: SuperClassTableSize;
- itsTable: ARRAY [1..1] OF ClassID; { Actually, a variable size array where each
- entry's byte offset corresponds to its
- ClassID and the entry's value is the
- ClassID of the immediate superclass }
- END;
- SuperClassTablePtr = ^SuperClassTable;
- SuperClassTableHandle = ^SuperClassTablePtr;
-
- ClassInfoProc = RECORD
- parentClassID: ClassID;
- itsInstanceSize: LONGINT;
- itsNameOff: INTEGER;
- END;
- ClassInfoProcPtr = ^ClassInfoProc;
- ClassInfoProcHandle = ^ClassInfoProcPtr;
-
- {$ELSEC}
- {$IFC OPTION(FARCODE)}
- ClassID = NoClass..$7FFFFFFF;
- {$ELSEC}
- ClassID = NoClass..32766;
- {$ENDC}
- {$ENDC}
-
- PClassID = ^ClassID;
- HClassID = ^PClassID;
-
- HClassIdTable = ^PClassIdTable;
- PClassIdTable = ^ClassIdTable;
- ClassIdTable = array[1..16000] of ClassID; { Actually variable size }
-
- {--------------------------------------------------------------------------------------------------}
-
- var
- pNoOfOrderedClasses: INTEGER;
- pOrderedClassIds: HClassIdTable;
- pClassTable: Handle; {handle to class table}
- pTObjectClassID: ClassID; {ClassID of the Root class}
-
- function GetClassID (obj: univ HClassID): ClassID;
- { Given an object, return the object's ClassID. }
-
- begin
- GetClassID := obj^^;
- end;
-
- procedure UpperCaseName (var s: Str255);
- var
- i: Integer;
-
- begin
- for i := 1 to Length(s) do
- s[i] := Chr(BAND(Ord(s[i]), $DF));
- end;
-
- {$IFC MAC68K}
- function _GetA5: LongInt;
- inline
- $2E8D;
- {$ENDC}
-
- {--------------------------------------------------------------------------------------------------}
-
- procedure GetClassNameFromID (class: ClassID; var clName: Str255);
- { Given an object id, return the object's name. ??? add error checking ??? }
-
- var
- classPtr: Ptr;
-
- begin
- {$IFC MWERKS}
- if class = NoClass then
- clName := ''
- else
- clName := StringPtr(class + ClassInfoProcPtr(class)^.itsNameOff)^;
- {$ELSEC}
- if (class = NoClass) | ODD(class) then
- clName := ''
- else
- begin
- {$IFC NOT Option(FarCode)}
- classPtr := Ptr(LongIntPtr(class + _GetA5 + 2)^);
- clName := StringPtr(Ord(classPtr) + 8 + IntegerPtr(Ord(classPtr) + 6)^ * 4)^;
- {$ELSEC}
- classPtr := Pointer(LongIntPtr(class + 2)^);
- clName := StringPtr(Ord4(classPtr) + 12 + IntegerPtr(Ord4(classPtr) + 10)^ * 8)^;
- {$ENDC}
- end;
- {$ENDC}
- end;
-
- {--------------------------------------------------------------------------------------------------}
-
- function GetClassIDFromName (clName: Str255): ClassID;
- { Given an object name, return its id. }
-
- var
- high, low, index: INTEGER;
- nameFromTable: Str255;
- compareResult: INTEGER;
- id: ClassID;
-
- begin
- UpperCaseName(clName);
-
- if pNoOfOrderedClasses > 0 then
- begin
- low := 1;
- high := pNoOfOrderedClasses;
- repeat
- index := BSR(low + high, 1); { (low + high) DIV 2 }
- id := pOrderedClassIds^^[index];
- GetClassNameFromID(id, nameFromTable);
- UpperCaseName(nameFromTable);
-
- compareResult := RelString(clName, nameFromTable, TRUE, TRUE);
- if compareResult = 0 then
- begin
- GetClassIDFromName := id;
- EXIT(GetClassIDFromName);
- end;
-
- if compareResult < 0 then
- high := index - 1
- else
- low := index + 1;
- until low > high;
- end;
-
- GetClassIDFromName := NoClass;
- end;
-
- {--------------------------------------------------------------------------------------------------}
- function GetClassSizeFromID (class: ClassID): Size;
- { Given an object id, return the class's instantiation size. }
-
- begin
- {$IFC MWERKS}
- GetClassSizeFromId := ClassInfoProcPtr(class)^.itsInstanceSize;
- {$ELSEC}
- {$IFC Not Option(FarCode)}
- GetClassSizeFromID := IntegerPtr(LongIntPtr(class + _GetA5 + 2)^ + 4)^;
- {$ELSEC}
- GetClassSizeFromID := IntegerPtr(LongIntPtr(class + 2)^ + 8)^;
- {$ENDC}
- {$ENDC}
- end;
-
- {--------------------------------------------------------------------------------------------------}
-
- procedure OrderClassIdsByName;
- var
- aClassName: Str255;
- nameFromTable: Str255;
- high, low, index: INTEGER;
- id: ClassID;
- tableSize, tableCount: INTEGER;
-
- begin
- pNoOfOrderedClasses := 0;
-
- { pClassTable is a handle to the %_MethTables segment, which contains Class Info Procs laid}
- { out sequentially, plus the %_InitObj routine which is just an RTS. We can go through all}
- { jump table entries for the segment and if the routine is *not* an RTS, we know it is a}
- { Class Info Proc - the name is at the end of the method list.}
-
- {$IFC MWERKS}
- {$IFC CW8COMP}
- tableSize := SuperClassTableHandle(pClassTable)^^.itsSize DIV sizeof(ClassID) - 1;
- {$ELSEC}
- tableSize := SuperClassTablePtr(pClassTable)^.itsSize DIV sizeof(ClassID);
- {$ENDC}
- id := sizeof(ClassID);
- {$ELSEC}
- tableSize := IntegerPtr(Ord(pClassTable^) + 2)^; {# of jump table entries in %_MethTables segment}
- {$IFC Not Option(FarCode)}
- id := 34 + IntegerPtr(pClassTable^)^; {offset to first jump table entry in %_MethTables segment}
- {$ELSEC}
- id := 34 + (Ord4(IntegerPtr(pClassTable^)^) * 8);
- {$ENDC}
- {$ENDC}
-
- pOrderedClassIds := HClassIdTable(NewHandle(tableSize * Sizeof(ClassID)));
- {FailNIL(pOrderedClassIds);}
-
- for tableCount := 1 to tableSize do
- begin
- { make sure this is a real Class Info Proc and not the %_InitObj routine }
- {$IFC MWERKS}
- {$IFC CW8COMP}
- IF SuperClassTableHandle(pClassTable)^^.itsTable[id DIV sizeof(ClassId)] <> 0 THEN
- {$ELSEC}
- IF SuperClassTablePtr(pClassTable)^.itsTable[id DIV sizeof(ClassId)] <> 0 THEN
- {$ENDC}
- {$ELSEC}
- if IntegerPtr(LongIntPtr(_GetA5 + 2 + id)^)^ <> $4E75 then
- {$ENDC}
- begin
- {$IFC MWERKS}
- {$IFC CW8COMP}
- GetClassNameFromID(SuperClassTableHandle(pClassTable)^^.itsTable[id DIV sizeof(ClassId)], aClassName);
- {$ELSEC}
- GetClassNameFromID(SuperClassTablePtr(pClassTable)^.itsTable[id DIV sizeof(ClassId)], aClassName);
- {$ENDC}
- {$ELSEC}
- {$IFC Not Option(FarCode)}
- GetClassNameFromID(ClassID(id), aClassName);
- {$ELSEC}
- GetClassNameFromID(ClassID(id + %_GetA5), aClassName);
- {$ENDC}
- {$ENDC}
-
- if pNoOfOrderedClasses = 0 then
- index := 1
- else
- begin
- low := 1;
- high := pNoOfOrderedClasses;
- repeat
- index := BSR(low + high, 1); { (low + high) DIV 2 }
- GetClassNameFromID(pOrderedClassIds^^[index], nameFromTable);
- UpperCaseName(nameFromTable);
- if aClassName < nameFromTable then
- high := index - 1
- else
- begin
- low := index + 1;
- index := index + 1;
- end;
- until low > high;
- end;
-
- if index <= pNoOfOrderedClasses then
- BlockMove(@pOrderedClassIds^^[index], @pOrderedClassIds^^[index + 1], (pNoOfOrderedClasses - index + 1) * sizeof(ClassID));
- {$IFC MWERKS}
- {$IFC CW8COMP}
- pOrderedClassIds^^[index] := SuperClassTableHandle(pClassTable)^^.itsTable[id DIV sizeof(ClassId)];
- {$ELSEC}
- pOrderedClassIds^^[index] := SuperClassTablePtr(pClassTable)^.itsTable[id DIV sizeof(ClassId)];
- {$ENDC}
- {$ELSEC}
- {$IFC Option(FarCode)}
- pOrderedClassIDs^^[index] := pOrderedClassIDs^^[index] + %_GetA5;
- {$ELSEC}
- pOrderedClassIds^^[index] := id;
- {$ENDC}
- {$ENDC}
- pNoOfOrderedClasses := pNoOfOrderedClasses + 1;
- end;
-
- { go on to next class ID (jump table entry offset + 2) }
- {$IFC MWERKS}
- id := id + sizeof(ClassId);
- {$ELSEC}
- id := id + 8;
- {$ENDC}
- end;
- end;
-
- {$IFC NOT MWERKS}
- { This routine is only present to force the Segment Loader to load the %_MethTables.}
- { It had better be the only non-Class Info Proc in that segment!}
- procedure _InitObj;
- external;
- {$ELSEC}
- VAR
- {$J+}
- {$IFC CW8COMP}
- __classInfo : Handle;
- {$ELSEC}
- __classinfo__ : Ptr;
- {$ENDC}
- {$J-}
- {$ENDC}
-
- { Essential one time initialization for this unit }
- procedure InitMethTableUtils;
- begin
- { Force the %_MethTables segment to be loaded and locked }
- {$IFC NOT MWERKS}
- _InitObj;
-
- { Obtain the handle to the Class Info Procs }
- pClassTable := GetNamedResource('CODE', '%_MethTables');
-
- {$ELSEC}
- {$IFC CW8COMP}
- pClassTable := __classinfo;
- HLockHi(pClassTable);
- {$ELSEC}
- pClassTable := @__classinfo__;
- {$ENDC}
- {$ENDC}
- { Sort the class IDs so that we can efficiently search them later. }
- OrderClassIdsByName;
- end;
-
- function MakeNewInstance (class: ClassID): Handle;
- var
- itsSize: INTEGER;
- obj: Handle;
-
- begin
- MakeNewInstance := nil;
- if class <> 0 then
- begin
- obj := NewHandleClear(GetClassSizeFromID(class));
-
- if obj <> nil then
- { Install class ID into object }
- HClassID(obj)^^ := class;
-
- MakeNewInstance := obj;
- end;
- end;
-
- {--------------------------------------------------------------------------------------------------}
-
- function NewByName (className: Str255): LongInt;
- { Creates an object of the given class name }
-
- begin
- NewByName := Ord4(MakeNewInstance(GetClassIDFromName(className)));
- end;
-
- function ClassName (obj: univ LongInt): Str255;
- var
- s: Str255;
-
- begin
- if (obj = 0) or Odd(obj) then
- s := ''
- else
- GetClassNameFromID(HClassID(obj)^^, s);
-
- ClassName := s;
- end;
-
- end. {UObject.p}z120,TCL.prefix
- {$SETC DebugExceptions = FALSE}
- {$SETC TCL_DEBUG = FALSE}
- {$SETC ResumeAfterError = TRUE}
- {$SETC CW8COMP = FALSE}
- {$%+}
- o
- o
-